The idea:
  Reorganize the list!  take all txt binary calls and place them at the end.  Set numbers as needed
  Change addius for tbl->txt offsetting to refer to new entry thingies.
  Wow.  That's rather easy!


Change the following to allow different base txt entry addresses
ALL PRESENT IN THE 675720 COMPRESSED BINARY
USE THE ONE FROM TEH H&X3D FONT!	conversion=80051A80+offset in file, or better yet just search
might have missed a few tbls in here, but the txt are the essential ones
-Don't move the tbls!-

target locations (overkill on size to support huge content)
name of bank	max size	codeword	new location
message_txt	290000	01914000	01000000
select_txt	1900	01BA5000	01290000
mail_txt	1F000	01BA7000	01291900
super_txt	2900	01BC7000	012B0900
ps_txt		3800	01BCA000	012B3200
string_txt	4300	01BCE000	012B6A00
maila_txt	5000	01BD3000	012BAD00
mailb_txt	7000	""	012BFD00
mailc_txt	3000	""	012C6D00
psz_txt	1000	""	012C9D00
superz_txt	1000	""	012CAD00
maila_tbl	610	""	012CBD00
mailb_tbl	610	""	012CC310
mailc_tbl	610	""	012CC920
psz_tbl	610	""	012CCF30
superz_tbl	610	""	012CD540
npc_name_str	770	01BE6000	012CDB50
				012CE2C0


BD4000	msg.txt
	8009E474	4C9F4	3C1800BD 27184000	LUI T8,00BD; ADDIU T8,T8,4000
CF9000	msg.tbl
	4C924	2A013F94	SLTI X,X,3F94	max entries hack
	4CBE8
	8009E3FC		3C0500D1		LUI A1,00D1
	8009E410		24A50000		ADDIU A1,A1,0000
	8009E430		3C0D00D1 25AD0000	LUI T5,00D1; ADDIU T5,T5,0000
D05000	select.txt
	80065614	13B94	3C1800D0 27185000	LUI T8,00D0; ADDIU T8,T8,5000
D06000	select.tbl
	1432C	SLTI	AT,A0,025F	max entries hack
	13AC4	--,025F
	8006559C		3C0500D0		LUI A1,00D0
	800655B0		24A56000		ADDIU A1,A1,6000
	800655D0		3C0D00D0 25AD6000	LUI T5,00D0; ADDIU T5,T5,6000
D07000	mail.txt
	80093964	41EE4	3C1800D0 27187000	LUI T8,00D0; ADDIU T8,T8,7000
D10000	mail.tbl
	41E14	SLTI	x,x,03D6		max entries hack
	4233C	,03D6
	800938EC		3C0500D1		LUI A1,00D1
	80093900		24A50000		ADDIU A1,A1,0000
	80093920		3C0D00D1 25AD0000	LUI T5,00D1; ADDIU T5,T5,0000
D11000	super.txt
	41B94	,03D6	max entries hack
	420C0	,,03D6
	41C54	SLTI	AT,V1,000E	potentially allow full string size
	800936E4	41C64	3C1800D1 27181000	LUI T8,00D1; ADDIU T8,T8,1000
D12000	super.tbl
	8009362C			LUI T9,00D1; ADDIU T9,T9,2000
	8009366C		3C0500D1		LUI A1,00D1
	80093680		24A52000		ADDIU A1,A1,2000
	800936A0		3C0D00D1 25AD2000	LUI T5,00D1; ADDIU T5,T5,2000
D13000	ps.txt
	41CD4	,,03D6	max entries hack
	42234	,,03D6
	41D94	SLTI	AT,V1,0020	potentially allow full string size
	80093824	41DA4	3C1800D1 27183000	LUI T8,00D1; ADDIU T8,T8,3000
D15000	ps.tbl
	8009376C			LUI T9,00D1; ADDIU T9,T9,5000
	800937AC		3C0500D1		LUI A1,00D1
	800937C0		24A55000		ADDIU A1,A1,5000
	800937E0		3C0D00D1 25AD5000	LUI T5,00D1; ADDIU T5,T5,5000
D16000	string.txt
	800C3F1C	7249C	3C1800D1 27186000	LUI T8,00D1; ADDIU T8,T8,6000
	800C401C	NOP to correct 4 char size limit?
D18000	string.tbl
	7250C	SLTI	AT,A3,07FF	max entries hack
	723CC	SLTI	AT,S0,07FF	
	800C3E64			LUI T9,00D2; ADDIU T9,T9,8000
	800C3EA4		3C0500D2		LUI A1,00D2
	800C3EB8		24A58000		ADDIU A1,A1,8000
	800C3ED8		3C0D00D2 25AD8000	LUI T5,00D2; ADDIU T5,T5,8000
D1A000	multibank

BBF360	character names - must hack larger!

+-+
80106AF4	character widths
+-+
80141FF0	msg_txt bank handlers
0x0	4	? [1, so maybe a "I'm loaded" flag]
0x4	4	index of text loaded (ie. clock warning = 0x9CC)
0x8	4	size
0xC	4	?
80142000	loaded msg_txt bank
+-+

Note some of these assume a short string value.
ie. select_txt assumes the string is 10 characters or less
We can force positive for all these tests, and hope for the best!

corrections for short-string text types:
+select_txt
	80065604	13B84	2C61FFFF	SLTIU	AT,V1,FFFF
	?80065DD0	ADDIU	A1,R0,000A
	80065E20	143A0	2C61FFFF	SLTIU	AT,V1,FFFF
	80065E34	143B4	ADDIU	A2,R0,000A	[unnecessary w/80065E20]
	80065E74	143F4	2C81000B	SLTIU	AT,A0,000B [optional - alignment]
	80065EA8	14428	2C81000B	SLTIU	AT,A0,000B [optional - alignment]
	80065EB0	14430	00062825	OR	A1,R0,A2
	?80065EBC	2881000A	SLTI	AT,A0,0010 [optional - alignment]
	*800A0F14	4F494	00D18821	ADDU	S1,A2,S1
	800652AC	1382C	2CC1FFFF	SLTIU	AT,A2,FFFF
	800652D4	13854	2CC1FFFF	SLTIU	AT,A2,FFFF
	800652FC	1387C	2CC1FFFF	SLTIU	AT,A2,FFFF
	80065324	138A4	2CC1FFFF	SLTIU	AT,A2,FFFF
	800651C0	13740	2CC1FFFF	SLTIU	AT,A2,FFFF

String_txt bank
try this:
800C401C	7259C	02004025	->	NOP to correct 4 char size limit?
8009EE0C	4D38C	24050004	->	000A

C-675720+58798	800AA218:	retrieve string for 7F1C - catchphrase command
27BDFFE0	ADDIU	SP,SP,FFE0
AFB00018	SW	S0,0018 (SP)
00808025	OR	S0,A0,R0	;S0=A0: 
AFBF001C	SW	RA,001C (SP)
AFA50024	SW	A1,0024 (SP)
AFA60028	SW	A2,0028 (SP)
//800AA230:
97AE0026	LHU	T6,0026 (SP)	;T6=A1->halfword
2401000E	ADDIU	AT,R0,000E	;AT=E
31CFF000	ANDI	T7,T6,F000	;T7=A1 & 0x0000F000
000FC303	SRA	T8,T7,0xC	;T8=upper nibble of T6
57010012	BNEL	T8,AT,800AA28C	;quit if =E
8FBF001C	LW	RA,001C (SP)
//800AA248:
A60E0000	SH	T6,0000 (S0)
93B9002B	LBU	T9,002B (SP)	;T9=A2->byte
260404E5	ADDIU	A0,S0,04E5	;A0+=4E5: p->target
24050004	ADDIU	A1,R0,0004	;A1=max strlen:	4	actual maximum =7
A219000B	SB	T9,000B (S0)	;Save byte -> A0+B
94E80000	LHU	T0,0000 (A3)
A6080520	SH	T0,0520 (S0)	;Save halfword -> A0+520
0C030FDC	JAL	800C3F70	;retrieve string from string_txt
94E60002	LHU	A2,0002 (A3)	;A2=str#
//800AA26C:	copy to final location
3C098013	LUI	T1,8013
95299E08	LHU	T1,9E08 (T1)	;T1=80129E08: 
3C058013	LUI	A1,8013
24A59E00	ADDIU	A1,A1,9E00	;A1=80129E00:	A1=p->source
26040004	ADDIU	A0,S0,0004	;A0=SO+4:	A0=p->target [80130DBC]
0C0253C1	JAL	80094F04	;Redirect to 800998C0, forcing string size=6
A6090002	SH	T1,0002 (S0)	;[0]->S0+2
8FBF001C	LW	RA,001C (SP)
//800AA28C:	return
8FB00018	LW	S0,0018 (SP)
27BD0020	ADDIU	SP,SP,0020
03E00008	JR	RA
00000000	NOP



on talking to an NPC:
calls 800C3F70 from 80094F24 @ 80094F44
str 1E4, len A
called by 802BFA8C @ 802BFAD8

27BDFFE0	ADDIU	SP,SP,FFE0
AFB00018	SW	S0,0018 (SP)
00808025	OR	S0,A0,R0	;S0=A0: 
AFBF001C	SW	RA,001C (SP)
AFA70024	SW	A3,0024 (SP)
//800AA230:
2401000E	ADDIU	AT,R0,000E	;AT=E
30AFF000	*ANDI	T7,A1,F000	;T7=A1 & 0x0000F000
000FC303	SRA	T8,T7,0xC	;T8=upper nibble of T6
17010012	*BNE	T8,AT,800AA284	;quit if =E
94E80000	LHU	T0,0000 (A3)
//800AA248:
A6080520	SH	T0,0520 (S0)	;Save halfword -> A0+520
A6050000	*SH	A1,0000 (S0)
A206000B	SB	A2,000B (S0)	;Save byte -> A0+B
24050007	*ADDIU	A1,R0,0007	;A1=max strlen:	4	actual maximum =7
260404E5	ADDIU	A0,S0,04E5	;A0+=4E5: p->target
0C02664B	JAL	8009992C	;memset 7 bytes
24060020	ADDIU	A2,R0,0020
8FA70024	LW	A3,0024 (SP)
260404E5	ADDIU	A0,S0,04E5	;A0+=4E5: p->target
0C030FDC	JAL	800C3F70	;retrieve string from string_txt
94E60002	LHU	A2,0002 (A3)	;A2=str#
//800AA268:	copy to final location
3C058013	LUI	A1,8013
24A59E00	ADDIU	A1,A1,9E00	;A1=80129E00:	A1=p->source
94A90008	*LHU	T1,0008 (A1)	;T1=80129E08: 
26040004	ADDIU	A0,S0,0004	;A0=SO+4:	A0=p->target [80130DBC]
24060007	ADDIU	A2,R0,0007
0C026630	JAL	800998C0	;Redirect to 800998C0, forcing string size=6
A6090002	SH	T1,0002 (S0)	;[0]->S0+2
//800AA284:	return
8FBF001C	LW	RA,001C (SP)
8FB00018	LW	S0,0018 (SP)
27BD0020	ADDIU	SP,SP,0020
03E00008	JR	RA
00000000	NOP
NOP
NOP

this caused a slight horror - now everyone is Bob!
blocks start at 801312E0; 528 each
801312E0
80131808


801425C0	Select_txt bank
[floats]
0x34	0x28	string buffer
0x5C	0x4	size of string 1
0x60	0x4	size of string 2
0x64	0x4	size of string 3
0x68	0x4	size of string 4
0x6C	0xA	previously selected string
0x78	0x4	size of previously selected string
0x7C	0x4	number of entries in curent menu
0x80	0x4	copied option# or -1
0x84	0x4	selected option#
0xDC	0x4	text controller switches +main bank uses this value!+
0x140	var	buffer for text copied to 0x34

note that the string buffer is also used for player name strings at sram load
change 8006521C	0x1379C	to ADDIU V1,V1,0140

80065DD0 will be used to copy a happy string in place of failure to retrieve
new strings will be 1 byte long, consisting of a single space
redirect both over-code failures to this routine

800A0F14	4F494	00D18821	ADDU	S1,A2,S1
this is in tandem to strlen being passed by 80065D90
should correct lengths when retrieving from ROM

	
okay, this +doesn't+ address the problem of it claiming the copied string (801425F4) is only 0xA long
this causes the next string to copy over the first...  Aegh!
THAT'S COMPUTED!?  Aegh...
#800651F8	0x13778	copy to buffer
LW	T1,0028 (SP)	;T1 was left unchanged, so extraneous
LW	A2,0030 (SP)
LW	A3,0034 (SP)
SLL	T8,T1,0x2
ADDU	T8,T8,T1
SLL	T8,T8,0x1
ADDU	V1,A2,T8
#rewrite:
8FA70034	+LW	A3,0034 (SP)
	LW	A2,0030 (SP)
10090003	BEQ	T1,R0,+3
0009C080	SLL	T8,T1,0x2
00D8C021	ADDU	T8,A2,T8
8F180058	LW	T8,0058 (T8)
	ADDU	V1,A2,T8

last bit is read from buffer.  need to get it to detect length of strings
80066BB0 calls 80090E1C...
80090E1C calls 80090CC0...
80090CC0 calls 80091E0C...
80091E0C calls 80091C98...
80091C98 reads characters from string 2; specificly, S0+0=text offset, S0+2C=character
8009034C reads it again, processes 7F/80 commands
800917C8 reads it again, probably to determine width (floats in here)

part of a loop - INCREMENT:
#80066CE8:	0x15268	call 80090E1C and loop it apparently
OR	A0,S6,R0
JAL	80090E1C
OR	A1,S5,R0
ADD.S	F20,F20,F26
LW	T8,0090 (SP)
ADDIU	S1,S1,0004	;S1+0x5C=current string length from index
ADDIU	S5,S5,000A	;manually advance 10 spaces each entry (curses!)
BNEL	S1,T8,80066C44
LW	T2,009C (SP)
#rewrite!	0x1527C
	ADDIU	S1,S1,0004	;S1+0x5C=current string length from index
8E2A0058	*LW	T2,0058 (S1)	;manually advance 10 spaces each entry (curses!)
1638FFCE	+BNE	S1,T8,80066C40
0155A821	*ADDU	S5,T2,S5

only 1st line appears... pulls string correctly, overwritting original on stack
800A0F14	4F494	00D18821	ADDU	S1,A2,S1
now, to address the thing that sets offset to entry 3-4 when used

@80065EE4 could save A2->SP+0x??
80065EE4	14464	AE060000	SW	A2,0000 (S0)

//800A0EF0:	0x	loop to recall text
JAL	80065040
NOP
OR	A0,V0,R0
OR	A1,S1,R0		;target copy address
LW	A2,0000 (S0)
JAL	80065D90
OR	A3,S2,R0
ADDIU	S0,S0,0004	;offset to the txt# in table; SP+74 as base
BNE	S0,S3,800A0EF0
ADDIU	S1,S1,000A	->ADDU	S1,A2,S1

Oh, this is funny!  After all that fuss, they +declare+ the size of the string!  Aegh!
//800A0F18:
SLTI	AT,S4,0003
BNEZ	AT,800A0F30	;branch on 1,2 entries
OR	S1,R0,R0
LUI	S1,8014
BEQ	R0,R0,800A0F30
ADDIU	S1,S1,2714	;80142714= 'start' of entry 3
//800A0F30:
SLTI	AT,S4,0004
BNEZ	AT,800A0F48	;branch on 1,2,3 entries
OR	S0,R0,R0
LUI	S0,8014
BEQ	R0,R0,800A0F48
ADDIU	S0,S0,271E	;8014271E= 'start' of entry 4
//800A0F48:
JAL	80065040
NOP
#800A0F50:	0x4F4D0	set some stuff: lets hope V1 really doesn't change!
LUI	A1,8014
LUI	A3,8014
ADDIU	T2,R0,000A	;length of string 2
ADDIU	T3,R0,000A	;length of string 3
ADDIU	T4,R0,000A	;length of string 4
SW	T4,0020 (SP)
SW	T3,0018 (SP)
SW	T2,0010 (SP)
ADDIU	A3,A3,270A	;p->string 2
ADDIU	A1,A1,2700	;p->string 1
OR	A0,V0,R0		;start of select_menu bank
ADDIU	A2,R0,000A	;length of string 1
SW	S1,0014 (SP)	;p->string 3 or NOP
JAL	80065278
SW	S0,001C (SP)	;p->string 4 or NOP

Last jump out.  This thing redirects a bit...
//800A0F8C:	0x
LW	A0,0088 (SP)
JAL	8009DC04		;advance to next 'char' in caller (usually msg_txt)
LW	A1,0000 (S5)
	ADDIU	SP,SP,FFE8
	SW	RA,0014 (SP)
	OR	A2,A0,R0
	LW	A0,000C (A2)
	JAL	800903A8
	ADDIU	A0,A0,0010
		ADDIU	SP,SP,FFE8
		SW	RA,0014 (SP)
		OR	A2,A0,R0
		JAL	8009034C	;returns V0=size of character or command
		ADDIU	A0,A2,A1
			LBU	V0,0000 (A0)	;character from string
			ADDIU	AT,R0,007F
			ADDIU	V1,R0,0001
			BNEL	V0,AT,80090390	;quit if not a 7F command
			ADDIU	AT,R0,0080
			LBU	V0,0001 (A0)	;7F command type
			BLTZ	V0,80090384	;handle invalid
			SLTI	AT,V0,0061
			BEQ	AT,R0,80090384	;only 0-60
			SLL	T6,V0,0x1	;command *2	
			LUI	V1,8010
			ADDU	V1,V1,T6		;80106BF4+offset
			BEQ	R0,R0,8009039C
			LB	V1,6BF4 (V1)	;V1=size of command
	//80090384:	invalid commands go here
			BEQ	R0,R0,8009039C	;assume it is only 2-bytes
			LB	V1,R0,0002
			-ADDIU	AT,R0,0080
	//80090390:
			BNEL	V0,AT,800903A0
			OR	V0,V1,R0
			ADDIU	V1,R0,0002	;80 commands are 2-bytes
			OR	V0,V1,R0
	//800903A0:
			JR	RA
			NOP
		LW	RA,0014 (SP)
		ADDIU	SP,SP,0018
		JR	RA
		NOP
	LW	RA,0014 (SP)
	ADDIU	SP,SP,0018
	JR	RA
	NOP
//800A0F98	0x	pack things up
LW	T5,0000 (S5)	;T5=current position in original text
ADDU	T6,T5,V0		;T6=incremented position
SW	T6,0000 (S5)	;save new position
OR	V0,R0,R0
LW	RA,0044 (SP)
LW	S0,002C (SP)
LW	S1,0030 (SP)
LW	S2,0034 (SP)
LW	S3,0038 (SP)
LW	S4,003C (SP)
LW	S5,0040 (SP)
JR	RA
ADDIU	SP,SP,0088

#well, either SP+4 is length or V1 is always the end.  Maybe...
#rewrite!	inefficient, but saves annoyance of altering branches...
//800A0F18:	0x4F498
0C019410	JAL	80065040
00000000	NOP
00008825	OR	S1,R0,R0
00008025	OR	S0,R0,R0
3C058014	LUI	A1,8014
24A52700	ADDIU	A1,A1,2700	;p->string 1
8FA60074	LW	A2,0074 (SP)	;length of string 1
8FAA0078	LW	T2,0078 (SP)	;length of string 2
8FAB007C	LW	T3,007C (SP)	;length of string 3
8FAC0080	LW	T4,0080 (SP)	;length of string 4
00C53821	*ADDU	A3,A2,A1		;p->string 2
2A810003	SLTI	AT,S4,0003
50200001	*BEQL	AT,R0,+1	;branch on 1,2 entries
01478821	*ADDU	S1,T2,A3		;p->string 3
00000000	NOP
00000000	NOP
//800A0F58:
2A810004	SLTI	AT,S4,0004
50200001	*BEQL	AT,R0,+1	;branch on 1,2,3 entries
01918021	*ADDU	S0,T4,S1
00000000	NOP
00000000	NOP
//800A0F48:
#800A0F6C:	0x4F4D0	set some stuff: lets hope V1 really doesn't change!
00000000	NOP
AFAC0020	SW	T4,0020 (SP)
AFAB0018	SW	T3,0018 (SP)
AFAA0010	SW	T2,0010 (SP)
00402025	OR	A0,V0,R0
AFB10014	SW	S1,0014 (SP)	;p->string 3 or NOP
0C01949E	JAL	80065278
AFB0001C	SW	S0,001C (SP)	;p->string 4 or NOP

Okay, rewrite works fine for all but 1st menu!
first menu's second option is erroneous (thinks its 1DD)
option becomes size, causes a crash.  Easy enough to fix in the script

another rewrite, entirely omitting the insanity of the last one
manually sets sizes here, doesn't bother testing for terminating spaces
accepts that the text will probably always be in the 'buffer' area - +0x140
#rewrite!	inefficient, but saves annoyance of altering branches...
//800A0EC4:	4F444
BNEZ	AT,800A0F8C	->	800A0F64	14200027
-
BEQ	AT,R0,800A0F8C	->	800A0F64	10200025
//800A0F20:	0x4F4A0
00005825	*OR	T3,R0,R0
00006025	*OR	T4,R0,R0
3C058014	LUI	A1,8014
24A525C0	*ADDIU	A1,A1,25C0	;p->base
8FA60074	LW	A2,0074 (SP)	;length of string 1
8FAA0078	LW	T2,0078 (SP)	;length of string 2
2A810003	SLTI	AT,S4,0003
50200001	BEQL	AT,R0,+1	;branch on 1,2 entries
8FAB007C	LW	T3,007C (SP)	;length of string 3
2A810004	SLTI	AT,S4,0004
50200001	BEQL	AT,R0,+1	;branch on 1,2,3 entries
8FAC0080	LW	T4,0080 (SP)	;length of string 4
ACB4007C	*SW	S4,007C (A1)	;save #entries
ACAC0068	*SW	T4,0068 (A1)	;save strlens
ACAB0064	*SW	T3,0064 (A1)
ACAA0060	*SW	T2,0060 (A1)
ACA6005C	*SW	A2,005C (A1)
//800A0F64:
8FA40088	ETC
0C027701	ETC
8EA50000	ETC
8EAD0000	ETC
01A27021	ETC
AEAE0000	ETC
00001025	ETC
8FBF0044	ETC
8FB0002C	ETC
8FB10030	ETC
8FB20034
8FB30038
8FB4003C
8FB50040
03E00008
27BD0088

***DO THIS STUFF STILL***
for the record, the widths are all wrong.  must correct
now, just change EvErYtHiNg that expects text at 0x34 to 0x140 0.o
//8006536C:	138EC
ADDIU	S1,A0,0034	->	0140
//80066C38:	0x151B8	
26150140	ADDIU	S5,S0,0140

80066130	set everything so you can copy the selected select_txt menu option
ADDIU	SP,SP,FFE0
SW	RA,0014 (SP)
OR	A3,A0,R0		;base for the menu code
LW	V1,0084 (A3)	;V1=selected option#
SW	A3,0020 (SP)
ADDIU	A1,A3,006C	;A1=target location
SLL	T6,V1,0x2
ADDU	T6,T6,V1
SLL	T6,T6,0x1
ADDU	A0,A3,T6
ADDIU	A0,A0,0034	;A0=source string
ADDIU	A2,R0,000A	;manual strlen
JAL	800360E0
SW	V1,0018 (SP)
//80066168:
LW	V1,0018 (SP)	;V1=selected again
LW	A3,0020 (SP)	;A3=base again
SLL	T7,V1,0x2
ADDIU	V0,A3,0034	;V0=source again
ADDU	T8,V0,T7		;T8=offset to strlen for selected, -0x28
LW	T9,0028 (T8)	;T9=strlen for selected
SW	V1,004C (V0)	;save selected to base+0x80
SW	T9,0044 (V0)	;save strlen for copy to base +0x78
LW	RA,0014 (SP)
JR	RA
ADDIU	SP,SP,0020

800360E0	copy the selected string into the selected buffer
BEQ	A2,R0,8003614C
OR	A3,A1,R0
BEQ	A0,A1,8003614C
SLT	AT,A1,A0
BNEL	AT,R0,80036114
SLTI	AT,A2,0010	->	0028	;for new location
ADD	V0,A0,A2
SLT	AT,A1,V0
BEQL	AT,R0,80036114
SLTI	AT,A2,0010	->	0028
BEQ	R0,R0,80036278
SLTI	AT,A2,0010	->	0028
-SLTI	AT,A2,0010	->	0028
//80036114:
BNEZ	AT,8003612C
NOP
ANDI	V0,A0,0003
ANDI	V1,A1,0003
BEQ	V0,V1,80036154
NOP
//8003612C
BEQ	A2,R0,8003614C
NOP
ADDU	V1,A0,A2
//80036138:	LOOPUS TO COPY
LB	V0,0000 (A0)
ADDIU	A0,A0,0001
ADDIU	A1,A1,0001
BNE	A0,V1,80036138
SB	V0,FFFF (A1)
//8003614C:
JR	RA
OR	V0,A3,R0

#rewrite	to new location!
#80066130	0x146B0
	ADDIU	SP,SP,FFE0
	SW	RA,0014 (SP)
	OR	A3,A0,R0		;base for the menu code
	LW	V1,0084 (A3)	;V1=selected option# (0-3)
	SW	A3,0020 (SP)
ACE30080	*SW	V1,0080 (A3)	;save selected to base+0x80
24E50034	*ADDIU	A1,A3,0034	;A1=target location
24E40140	*ADDIU	A0,A3,0140	;A0=strings
240FFFFF	*ADDIU	T7,R0,FFFF	;T7=counter
25EF0001	*ADDIU	T7,T7,0001	;counter++
000F7080	*SLL	T6,T7,0x2	;T6=option#->offset
00EE7021	*ADDU	T6,T6,A3		;T6=base+offset to strlen
8DC6005C	*LW	A2,005C (T6)	;A2=strlen
546FFFFB	*BNEL	V1,T7,FFFB
00C42021	*ADDU	A0,A0,A2		;A0=base+running total
0C00D838	JAL	800360E0
ACE60078	*SW	A2,0078 (A3)	;strlen of copy
//80066168:
8FBF0014	LW	RA,0014 (SP)
03E00008	JR	RA
27BD0020	ADDIU	SP,SP,0020	*NOP
	*NOP
	*NOP
	*NOP
	*NOP


routines themselves:
8009E558	4CAD8	msg_main
80065D90		select
		80065528	13AA8	process tbl independently
		
+-+-+

800360E0:	thing that copies (saves) the selected string
more specificly, this:
ADDU	V1,A0,A2		;V1=offset to string (A0) + size0xA (A2)
#80036138		COPY THE STRING
LB	V0,0000 (A0)	;V0=source byte
ADDIU	A0,A0,0001	;move index for source
ADDIU	A1,A1,0001	;move index for target
BNE	A0,V1,80036138	;keep going if current (A0) != end (V1)
SB	V0,FFFF (A1)	;save to target
#8003614C		return and save size
JR	RA
OR	V0,A3,R0

called by 80066130-80066190
manually calculates offset, sets size

+-+-+
	
Below is interesting, but I was sort of overshooting with it...
++++++++++++++

return from table entry # pull, grabbing rom address...

80026828:
...
//800268DC:	grab rom address (tbl) on hit
LW	T8,0008 (V0)	T8=ROM for TBL
LW	T2,0000 (V0)	T2=start codeword
LW	A1,0038 (SP)	[A1=80147850]
ADDU	T9,T8,T1	T9=ROM + codeword (T1)
LW	A2,0034 (SP)	[A2=8]
JAL	80026500	loads rom data; CART_ADDR=A0, DRAM_ADDR=A1, WR_LEN=A2
SUBU	A0,T9,T2	A0=actual rom address (ROM + codeword - start_codeword)
//800268F8:
BEQ	R0,R0,800269D4
LW	RA,001C (SP)
...
//800269D4:	return...
LW	S0,0018 (SP)
ADDIU	SP,SP,0040
JR	RA
NOP

-
800269E4:	text recall, or something like that
...
//80026A0C:
OR	A1,S2,R0
JAL	8002DFA0
ADDIU	A2,R0,0001	A2=1
//80026A18:
LW	A0,0034 (SP)
BEQL	A0,R0,80026A50
	LW	RA,0024 (SP)
JAL	80026828	pull data for specific codeword?; RETURNS A0=address of data
OR	S0,A0,R0
//80026A2C:
LW	A0,0018 (S0)	[A0=80147818=801477E4]
BEQL	A0,R0,80026A0C	IF NOT POINTER, TRY TRY AGAIN
	OR	A0,S1,R0	[A0=S1=8003FF60 - PROBABLY IN STACK]
LW	A1,001C (S0)	[A1=8014781C=0]
JAL	8002DB20	
OR	A2,R0,R0	A2=0
BEQ	R0,R0,80026A0C	
OR	A0,S1,R0
LW	RA,0024 (SP)
//80026A50:	return...
LW	S0,0018 (SP)
LW	S1,001C (SP)
LW	S2,0020 (SP)
JR	RA
ADDIU	SP,SP,0038

-----------------------
80026E10:	called by all recall routines to extract data from ROM
	accepts: A0=p->target, A1=codeword, A2=strlen, A3=p->debug string, SP+10=debug errcode(?)
ADDIU	SP,SP,FF90
SW	RA,0024 (SP)
SW	A0,0070 (SP)	save target [80142000]
SW	A1,0074 (SP)	save codeword [C1B008]
SW	A2,0078 (SP)	save strlen [1A8]
LW	T6,0080 (SP)	[3C2 - set from prior routine]
SW	A3,005C (SP)	[80117280: filename string - set from prior routine]
ADDIU	A0,SP,0034
ADDIU	A1,SP,0030
ADDIU	A2,R0,0001	A2=1
JAL	80034D60	SET SOME STOCK DEFAULT VALUES?
SW	T6,0060 (SP)
//80026E40:
ADDIU	T7,SP,0034	#same as A0 from before
SW	T7,0014 (SP)	save path to data just copied to stack
ADDIU	A0,SP,0050
LW	A1,0070 (SP)	A1=target
LW	A2,0074 (SP)	A2=codeword
LW	A3,0078 (SP)	A3=strlen
SW	R0,0010 (SP)
JAL	80026A64
SW	R0,0018 (SP)
//80026E64:
ADDIU	AT,R0,FFFF
BNE	V0,AT,80026E78
ADDIU	A0,SP,0034
BEQ	R0,R0,80026E8C
LW	RA,0024 (SP)
//80026E78:
OR	A1,R0,R0
JAL	8002DFA0
ADDIU	A2,R0,0001
//80026E84:
OR	V0,R0,R0
LW	RA,0024 (SP)
ADDIU	SP,SP,0070
JR	RA
NOP

+++
80034D60:	they're memory allocation values of some sort
	accepts: A0=p->entry, A1=p->data?, A2=flag? value?
LUI	T6,8004
LUI	T7,8004
ADDIU	T6,T6,CE20	;T6=8003CE20
ADDIU	T7,T7,CE20	;T7=8003CE20
SW	T6,0000 (A0)	;T6->entry+0: 
SW	T7,0004 (A0)	;T7->entry+4: 
SW	R0,0008 (A0)	;0->entry+8: 
SW	R0,000C (A0)	;0->entry+C: 
SW	A2,0010 (A0)	;A2->entry+10: size in doublewords?  validity flag?
JR	RA
SW	A1,0014 (A0)	;A1->entry+14: p->data?

-----------------------
80026500:	load the rom data
	CART_ADDR=A0, DRAM_ADDR=A1, WR_LEN=A2
...
SOMEWHERE ALONG THE LINE 8003226C CALLS rom load routine
[80147850 = ROM AE82E8, size 8 - an entry in the msg.tbl]

=_=

For lack of a better place to put this:
map column will now use letters (to avoid changing 200+ lines of text)
Thankfully there's already two sets.  Just need to:
1) keep it from making pointers out of the offsets in map thingy
2) use the offsets and add to a base pointer

803B8B40:	C-725580+D70	create pointers from offsets
ADDIU	SP,SP,FFD8
SW	RA,0024 (SP)
SW	S2,0020 (SP)
SW	S1,001C (SP)
SW	S0,0018 (SP)
//803B8B54:
LW	T6,0028 (A0)
LUI	AT,8000
LUI	S0,803C
ADDU	T7,T6,AT
LUI	AT,8014
SW	T7,58D0 (AT)
ADDIU	S0,S0,A0E8	;S0=803BA0E8: start of 6 offsets to images
OR	S1,R0,R0	;S1=count
ADDIU	S2,R0,0006	;S2=#offsets
//803B8B78:
JAL	8009ADA8
LW	A0,0000 (S0)	;A0=offset
ADDIU	S1,S1,0001	;count++
ADDIU	S0,S0,0004	;addy+=4
BNE	S1,S2,803B8B78
SW	V0,FFFC (S0)
//803B8B90:
LUI	A0,0C00
JAL	8009ADA8
ADDIU	A0,A0,73B8	;A0=0C0073B8
LUI	AT,803C
LUI	A0,0C00
SW	V0,E258 (AT)	;converted->803BE258: 
JAL	8009ADA8
ADDIU	A0,A0,1510	;A0=0C001510
LUI	AT,803C
LUI	A0,0C00
SW	V0,E254 (AT)
JAL	8009ADA8
ADDIU	A0,A0,15C0
LUI	AT,803C
LUI	A0,0C00
SW	V0,E250 (AT)
JAL	8009ADA8
ADDIU	A0,A0,1620
LUI	AT,803C
LUI	A0,0C00
SW	V0,E24C (AT)
JAL	8009ADA8
ADDIU	A0,A0,1680
LUI	AT,803C
LUI	A0,0C00
SW	V0,E248 (AT)
JAL	8009ADA8
ADDIU	A0,A0,7A40
LUI	AT,803C
LUI	A0,0C00
SW	V0,E25C (AT)
JAL	8009ADA8
ADDIU	A0,A0,7AD0
//803B8C14:
LUI	AT,803C
SW	V0,E260 (AT)
LW	RA,0024 (SP)
LW	S0,0018 (SP)
LW	S1,001C (SP)
LW	S2,0020 (SP)
JR	RA
ADDIU	SP,SP,0028

8009ADA8:	0x	convert 0X- offset type to a rdram address
	accepts: A0=0X-offset
	returns: V0=rdram address
	fries: AT,T0,T6,T7,T8,T9
SLL	T6,A0,0x4
SRL	T7,T6,0x1C	;T7=offset type	the X, in other words
SLL	T8,T7,0x2	;T8=type->offset
LUI	T9,8014
ADDU	T9,T9,T8
LUI	AT,00FF
LW	T9,58A0 (T9)	;T9=801458A0+off: table of offset->pointer conversions
ORI	AT,AT,FFFF	;AT=00FFFFFF: address mask
AND	T0,A0,AT	;T0=address offset
LUI	AT,8000
ADDU	V0,T9,T0	;V0=address offset + pointer conversion
ADDU	V0,V0,AT	;V0=rdram address
JR	RA
NOP

The characters for the current position are drawn using 803B969C:
//803B96B0:	+18E0	columns
LUI	A0,803C
ADDIU	A0,A0,A0E8	;A0=803BA0E8: base for pointer lookup
LW	V1,0298 (T6)
LUI	T7,DB06
ORI	T7,T7,0020
OR	V0,V1,R0
SW	T7,0000 (V0)
LBU	T8,0000 (A1)	;'number' to appear
LUI	T2,DB06
ADDIU	V1,V1,0008
SLL	T9,T8,0x2	;T9=#->offset
ADDU	T0,A0,T9	;T0=p->image DL
LW	T1,0000 (T0)	;T1=image DL pointer
//803B96E4:	+1914	rows
ORI	T2,T2,0024
ADDIU	AT,R0,0004
SW	T1,0004 (V0)
LBU	T3,0001 (A1)	;'letter' to appear
ADDIU	V1,V1,0008
SLL	T4,T3,0x2	;T4=#->offset
ADDU	T5,A0,T4	;T5=p->image DL
LW	T6,0000 (T5)	;T6=image DL pointer
SW	T6,0004 (V0)

make a new offset table for columns at 803BA22C:
0C00A960	1
0C00B060	2
0C00B160	3
0C00B660	4
0C00B760	5
heck, tack the old guys on the end of it so the converter doesn't work as hard

//803B96B0:	+18E0	columns	revision
LUI	A0,803C
ADDIU	A0,A0,A22C	;A0=803BA0E8: base for pointer lookup
//803B9708:	+1938	rows
LW	T6,0014 (T5)	;T6=image DL pointer



//803B8B54:	+D84	REVISION
	LW	T6,0028 (A0)
	LUI	AT,8000
	LUI	S0,803C
	ADDU	T7,T6,AT
	LUI	AT,8014
	SW	T7,58D0 (AT)
	*ADDIU	S0,S0,A22C	;S0=803BA22C: start of images
	OR	S1,R0,R0	;S1=count
	*ADDIU	S2,R0,000B	;S2=#offsets

here's a fun way to clear out some space ;*)
803BA218-A260 are used here:
//803B92B4:	+14E4
LW	T9,001C (SP)
LUI	T0,803C
LUI	AT,FF00
ADDU	T0,T0,T9
LW	T0,A218 (T0)
REVISED!!!
8FB9003C	*LW	T9,003C (SP)
	LUI	T0,803C
	LUI	AT,FF00
	ADDU	T0,T0,T9
9108A218	*LBU	T0,A218 (T0)

@_@

catalog dialog:
"Unavailable" string moved and extended
C-72F5D0 + 0x2168
24060005	->	24060008 
15C0000C
46000086
3C05808B
24A5F964	->	24A5F9B4 
27A40050
24060005	->	24060008 
0C026630
E7A00044

&_&

Writting a letter dialog:	cross reference with cursor positions dASM
803CC968	
		1EEE19001214C297B2121721
		91DCBA9D10CB02E796B7F40C
		
803CC980	color values x11
803CC9AC	resource file call	00A7B000 00A7B7E0

803CCA56 starts the address list:
0x0	6	recipient name
0x6	6	town name
0xC	1	??
0xD	1	same as 0xC
0xE	2	30F9
0x10	1	01
0x11	1	00

800998C0, called through 800B77A4, used to copy name to buffer (sets size to 6)
Both called by 8009C70C, which gets name list
803CB330 is the constructor!
ADDIU	SP,SP,FFC8
SW	S7,0030 (SP)
OR	S7,A0,R0
SW	RA,0034 (SP)
SW	S6,002C (SP)
SW	S5,0028 (SP)
SW	S4,0024 (SP)
SW	S3,0020 (SP)
SW	S2,001C (SP)
SW	S1,0018 (SP)
SW	S0,0014 (SP)
//803CB35C:
LUI	S0,8013
LUI	S4,8013
ADDIU	S0,S0,0DB8	;S0=80130DB8: 
ADDIU	S1,S7,0086	;S1=target for the recipient entries
LW	S4,6FD8 (S4)	;S4=80136FD8: p->p->player+town name
OR	S3,R0,R0	;S3=listcount
OR	S2,R0,R0	;S2=count
ADDIU	S6,R0,000F	;S6=F, max number of villagers
ADDIU	S5,R0,FFFF	;S5=-1, for test later
//803CB380:
JAL	800A69C8	;V0=TRUE if short at A0 isn't an actor ID
OR	A0,S0,R0
	LHU	V0,0000 (A0)
	OR	V1,R0,R0
	BNEZ	V0,800A69E4
	ANDI	T7,V0,F000
	LBU	T6,000A (A0)
	ADDIU	AT,R0,00FF
	BEQ	T6,AT,800A69F4
//800A69E4:
	SRA	T8,T7,0xC
	ADDIU	AT,R0,000E
	BEQL	T8,AT,800A69FC
	OR	V0,V1,R0
//800A69F4:
	ADDIU	V1,R0,0001
	OR	V0,V1,R0
	JR	RA
	NOP
BNEZ	V0,803CB3B4
OR	A0,S4,R0
ADDIU	A1,S0,0010
JAL	800A7238
ADDIU	A2,R0,0007
//803CB39C:
BEQ	V0,S5,803CB3B4	;skip if V0=-1
OR	A0,S1,R0	;A0=p->new entry
JAL	8009C70C	;make an entry
OR	A1,S0,R0	;A1=p->source for names
ADDIU	S1,S1,0012	;S1+=0x12: next entry
ADDIU	S3,S3,0001	;listcount++
//803CB3B4:
ADDIU	S2,S2,0001	;count++
BNE	S2,S6,803CB380	;loop until all the possible townfolk slots have been tested
ADDIU	S0,S0,0528	;next townfolk thingie?
//803CB3C0:
SLTI	AT,S3,0008
BEQ	AT,R0,803CB3D8	;if listcount>8, branch
ADDIU	T6,R0,0008		;T6=force page 1 entry # to 8
SB	S3,0008 (S7)	;stow count away
BEQ	R0,R0,803CB3E4
SB	R0,0009 (S7)	;0 on page two
//803CB3D8:
ADDIU	T7,S3,FFF8	;T7=# to appear on page 2
SB	T6,0008 (S7)	;8 on page one
SB	T7,0009 (S7)	;rest on page 2
//803CB3E4:	wrap it up Santa.  wrap  it  up
LW	RA,0034 (SP)
LW	S0,0014 (SP)
LW	S1,0018 (SP)
LW	S2,001C (SP)
LW	S3,0020 (SP)
LW	S4,0024 (SP)
LW	S5,0028 (SP)
LW	S6,002C (SP)
LW	S7,0030 (SP)
JR	RA
ADDIU	SP,SP,0038


8009C70C:	0x	Get name list of actors
ADDIU	SP,SP,FFD8
SW	S1,0018 (SP)
SW	S0,0014 (SP)
OR	S0,A0,R0	;S0=buffer target [803CCA56]
OR	S1,A1,R0	;string source address (from SRAM?)
SW	RA,001C (SP)
ADDIU	T6,R0,0001
SB	T6,0010 (S0)	;1->0x10 slot
ADDIU	A0,SP,0020
JAL	800ACD18	;retrieve actor's name
OR	A1,S1,R0
//8009C738:
OR	A0,S0,R0	;A0=p->target
JAL	800B77A4	;copy 6-byte string to target
ADDIU	A1,SP,0020	;A1=p->source
//8009C744:
LHU	T7,0002 (S1)	;T7=30F9	S1=[80130DB8]
ADDIU	A0,S0,0006	;A0=offset to town name
ADDIU	A1,S1,0004	;A1=p->town name
JAL	80094F04	;copy town name
SH	T7,000E (S0)	;T7->0xE slot
//8009C758
LHU	T9,0000 (S1)	;T9=?	[E046]
LBU	T2,000A (S1)	;T2=?	[46]
SLL	T0,T9,0x8	;T0=T9*100	[4600]
OR	T3,T0,T2	;T3=[4646]
SH	T3,000C (S0)	;save to 0xC slot
LW	RA,001C (SP)
LW	S0,0014 (SP)
LW	S1,0018 (SP)
JR	RA
ADDIU	SP,SP,0028

80094F04	0x	Redirect to 800998C0, forcing string size=6
	accepts: A0=p->target, A1=p->source, A2 set to 6
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
JAL	800998C0
ADDIU	A2,R0,0006
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

800ACD18	0x	probably figures out what npc name should be here and loads them
ADDIU	SP,SP,FFD8
SW	RA,0014 (SP)
SW	A0,0028 (SP)
OR	A3,A1,R0
LUI	A2,8011
BEQ	A3,R0,800ACD58
ADDIU	A2,A2,B810	;A2=8010B810: 
LHU	A1,0000 (A3)
ADDIU	AT,R0,000E
ANDI	T6,A1,F000
SRA	T7,T6,0xC
BNEL	T7,AT,800ACD5C
LW	A0,0028 (SP)
JAL	800ACCAC	;retrieve actor's name
ADDIU	A0,SP,001C
ADDIU	A1,SP,001C
//800ACD58:
LW	A0,0028 (SP)
JAL	800998C0	;copy string to target
ADDIU	A2,R0,0008	;size is 8
LW	RA,0014 (SP)
ADDIU	SP,SP,0028
JR	RA
NOP


803CBDD4	This bugger writes the names on-screen.
in particular...
//803CBF14:
ADDIU	AT,R0,0001
BNE	S6,AT,803CBF5C
LW	A0,0094 (SP)
LBU	T0,0005 (S3)
BNE	S1,T0,803CBF5C
NOP
BNEZ	S5,803CBF54
OR	V0,S8,R0
LBU	T1,0006 (S3)
ADDIU	S0,S1,0001
BEQ	T1,R0,803CBF54
NOP
BNE	S2,S0,803CBF54
NOP
BEQ	R0,R0,803CBF9C
OR	V0,S7,R0
//803CBF54:
BEQ	R0,R0,803CBF9C
ADDIU	S0,S1,0001
//803CBF5C:
BNEZ	S5,803CBF94
LUI	V1,803D
LBU	T2,0006 (S3)
LUI	V0,803D
ADDIU	S0,S1,0001
BEQ	T2,R0,803CBF8C
ADDIU	V0,V0,C998	;V0=803CC998
BNE	S2,S0,803CBF8C
NOP
LUI	V0,803D
BEQ	R0,R0,803CBF9C
ADDIU	V0,V0,C9A0
//803CBF8C:
BEQ	R0,R0,803CBF9C
ADDIU	S0,S1,0001
//803CBF94:
ADDIU	V0,V0,C99C
ADDIU	S0,S1,0001
//803CBF9C:
SWC1	F20,0010 (SP)
LBU	T3,0000 (V0)
MFC1	A3,F28
ADDIU	T6,R0,00FF
SW	T3,0014 (SP)
LBU	T4,0001 (V0)
OR	A1,S4,R0	;A1=text to write
ADDIU	A2,R0,0006	;length of name string
SW	T5,0018 (SP)
LBU	T5,0002 (V0)
SW	R0,0034 (SP)
SWC1	F22,0030 (SP)
SWC1	F22,002C (SP)
SW	R0,0028 (SP)
SW	R0,0024 (SP)
SW	T6,0020 (SP)
JAL	80090E98	;text writting routine
SW	T5,001C (SP)
//803CBFE4:
LBU	T7,0006 (S3)
ADDIU	S4,S4,0012	;next entry
ADDIU	T8,S1,0002
BEQL	T7,R0,803CC014
ADD.S	F20,F20,F26
BNEL	S2,T8,803CC014
ADD.S	F20,F20,F26
BNEL	S5,R0,803CC014
ADD.S	F20,F20,F26
BEQ	R0,R0,803CC014
ADD.S	F20,F20,F24
ADD.S	F20,F20,F26
//803CC014:
BNE	S0,S2,803CBF14
OR	S1,S0,R0
//803CC01C:
LW	RA,008C (SP)
LDC1	F20,0040 (SP)
LDC1	F22,0048 (SP)
LDC1	F24,0050 (SP)
LDC1	F26,0058 (SP)
LDC1	F28,0060 (SP)
LW	S0,0068 (SP)
LW	S1,006C (SP)
LW	S2,0070 (SP)
LW	S3,0074 (SP)
LW	S4,0078 (SP)
LW	S5,007C (SP)
LW	S6,0080 (SP)
LW	S7,0084 (SP)
LW	S8,0088 (SP)
JR	RA
ADDIU	SP,SP,0090

803CB4C4	this routine copies the name as the superscript:
//803CB558:
LBU	T3,0005 (V1)
SLL	T4,T3,0x3	;8#
ADDU	T4,T4,T3	;8#+1
SLL	T4,T4,0x1	;2(8#+1)=#*0x12
ADDU	A3,V1,T4	;A3=p->name for superscript
BEQ	R0,R0,803CB5B0
ADDIU	A3,A3,002C
//803CB574:
BNEL	V0,AT,803CB59C
LBU	T8,0005 (V1)
LBU	T5,0005 (V1)
SLL	T7,T5,0x3
ADDU	T7,T7,T5
SLL	T7,T7,0x1
ADDU	A3,V1,T7
BEQ	R0,R0,803CB5B0
ADDIU	A3,A3,0116
//803CB598:
LBU	T8,0005 (V1)	;T8=length of superscript
SLL	T6,T8,0x3
ADDU	T6,T6,T8
SLL	T6,T6,0x1
ADDU	A3,V1,T6
ADDIU	A3,A3,0086
//803CB5B0:
OR	A1,A3,R0
SW	A3,0020 (SP)
JAL	8009C438
SW	T0,0028 (SP)
//803CB5C0:
LW	A0,0020 (SP)
ADDIU	A1,R0,0006	;A1=max strlen
JAL	8009C1C0	;returns V0=actual strlen
ADDIU	A2,R0,0020
//803CB5D0:



REVISIONS!	this should get 8-letter names working!
//800ACD60:
ADDIU	A2,R0,0008	;size is 8
//803CB3AC:
ADDIU	S1,S1,0014	;S1+=0x14: next entry
//803CBFB8:
ADDIU	A2,R0,0008	;length of name string
//803CBFE8:
ADDIU	S4,S4,0014	;next entry
//803CB55C:
SLL	T4,T3,0x2	;4#
ADDU	T4,T4,T3	;4#+1
SLL	T4,T4,0x2	;4(4#+1)=#*0x14

one more:
//8009ED58:
ADDIU	A1,R0,0006	->	0008


Hold off on this hack until everything else that JALs this can be dealt with
//8009C728:
SB	T6,0012 (S0)	;1->0x12 slot
//8009C748:
ADDIU	A0,S0,0008	;A0=offset to town name
//8009C754:
SH	T7,0010 (S0)	;T7->0x10 slot
//8009C768
SH	T3,000E (S0)	;save to 0xE slot

known JAL to 8009C70C:
800A83D4
800A909C
800A9440
800B9D80
800BB968

Aegh!  This is a huge ordeal, so benching it for now

=_=

802C3AF4	C-854A60:0xC74	text-writting routine for "no controller" warning
ADDIU	SP,SP,FFB0
SW	S0,0048 (SP)
OR	S0,A0,R0
SW	RA,004C (SP)
JAL	802C3A04
OR	A0,S0,R0
LW	A0,0000 (S0)
JAL	80090F10
ADDIU	A1,R0,0001
//802C3B18:
LUI	AT,3F80		;z scale; in other words, size (3F40 is sensible)
MTC1	AT,F0
LUI	AT,42F0		;y position
MTC1	AT,F4
LUI	A1,802C
ADDIU	T6,R0,0032
ADDIU	T7,R0,001E
ADDIU	T8,R0,001E
ADDIU	T9,R0,00FF
ADDIU	T0,R0,0001
ADDIU	T1,R0,0001
SW	T1,0038 (SP)
SW	T0,0028 (SP)
SW	T9,0020 (SP)
SW	T8,001C (SP)
SW	T7,0018 (SP)
SW	T6,0014 (SP)
ADDIU	A1,A1,5328	;A1=802C5328: first line of text
OR	A0,S0,R0
ADDIU	A2,R0,0014	;A2=string length
LUI	A3,425C		;x position
SW	R0,0024 (SP)
SW	R0,002C (SP)
SWC1	F0,0030 (SP)
SWC1	F0,0034 (SP)
JAL	80090E1C
SWC1	F4,0010 (SP)
//802C3B84:
LUI	AT,3F80		;z scale; in other words, size (3F40 is sensible)
MTC1	AT,F0
LUI	AT,430C		;y position
MTC1	AT,F6
LUI	A1,802C
ADDIU	T2,R0,0032
ADDIU	T3,R0,001E
ADDIU	T4,R0,001E
ADDIU	T5,R0,00FF
ADDIU	T6,R0,0001
ADDIU	T7,R0,0001
SW	T7,0038 (SP)
SW	T6,0028 (SP)
SW	T5,0020 (SP)
SW	T4,001C (SP)
SW	T3,0018 (SP)
SW	T2,0014 (SP)
ADDIU	A1,A1,533C	;A1=802C533C: second line of text
OR	A0,S0,R0
ADDIU	A2,R0,0014	;A2=string length
LUI	A3,4280		;x position
SW	R0,0024 (SP)
SW	R0,002C (SP)
SWC1	F0,0030 (SP)
SWC1	F0,0034 (SP)
JAL	80090E1C
SWC1	F6,0010 (SP)
//802C3BF0:
LUI	AT,3F80		;z scale; in other words, size (3F40 is sensible)
MTC1	AT,F0
LUI	AT,4320		;y position
MTC1	AT,F8
LUI	A1,802C
ADDIU	T8,R0,0032
ADDIU	T9,R0,001E
ADDIU	T0,R0,001E
ADDIU	T1,R0,00FF
ADDIU	T2,R0,0001
ADDIU	T3,R0,0001
SW	T3,0038 (SP)
SW	T2,0028 (SP)
SW	T1,0020 (SP)
SW	T0,001C (SP)
SW	T9,0018 (SP)
SW	T8,0014 (SP)
ADDIU	A1,A1,5350	;A1=802C5350: third line of text
OR	A0,S0,R0
ADDIU	A2,R0,0014	;A2=string length
LUI	A3,4248		;x position
SW	R0,0024 (SP)
SW	R0,002C (SP)
SWC1	F0,0030 (SP)
SWC1	F0,0034 (SP)
JAL	80090E1C
SWC1	F8,0010 (SP)
//802C3C5C:
LW	A0,0000 (S0)	;A0 placed at SP+0
JAL	8009104C		;moves pointer at 801462B4 back 0x40
ADDIU	A1,R0,0001	;A1 placed at SP+4
LW	RA,004C (SP)
LW	S0,0048 (SP)
ADDIU	SP,SP,0050
JR	RA
NOP

personally I think this is a funnier message, being 5-7-5 and all..
		"Please turn off the game
		 and plug a controller in
		   controller port one"


well, it's all still fixed-width, but this would clean it up a little:
+C98 802C3B18	->	3F30
+CE4 802C3B64	->	0018

+D04 802C3B84	->	3F30
+D48 802C3BC8	->	2130
+D50 802C3BD0	->	0018
+D54 802C3BD4->	3C074260

+D70 802C3BF0	->	3F30
+DB4 802C3C34	->	2320
+DBC 802C3C3C	->	0013
+DC0 802C3C40	->	4298

make a little room from more text and better compression:
compact +24E4 table to 1-byte values:
802C3D08	ADDIU T3,T3,5364->	5376	256B2166
802C3D18	LW-> LB	83182166	
802C3D90	SLL A1,V0,0x2-> OR A1,R0,V0	00022825
802C3DA0	LW-> LB	81
802C3DE4	00022825
802C3DF4	LW T0,0004 (T7)-> LB T0,0001 (T7)	81E80001	
802C3E4C	LW V0,0014 (T3)-> LB V0,0006 (T3)	81620006
(hmm...  this just throws base.  need to offset)

802C401C	SLL V0,V0,0x2-> NOP
802C4028	LW T4,542C (T4)-> LB T4,XXXX (T4)	
802C4034	LW T8,5404 (T7)-> LB T8,XXXX (T7)	
802C4038	LW T1,5418 (T1)-> LB T1,XXXX (T1)	

802C407C	SLL V0,V0,0x2-> NOP
802C4088	LW T7,5468 (T7)-> LB T7,XXXX (T7)	
802C4094	LW T1,5440 (T9)-> LB T1,XXXX (T9)	
802C4098	LW T3,5454 (T3)-> LB T3,XXXX (T3)	

802C4130	SLL V0,V0,0x2-> NOP
802C413C	LW T4,53F0 (T4)-> LB	81
802C4148	LW T8,53C8 (T7)-> LB	81
802C414C	LW T6,53DC (T6)-> LB	81


=_=

8005A070	0x	selects one of 5 time retrieval routines
	calls specific one from table at 801162A8
	accepts: A0=time value to grab
	returns: V0=variable
	fries: AT,V1,T6 (T7 with option 0)
SLTIU	AT,A0,0005
BEQ	AT,R0,8005A148
OR	V1,R0,R0
SLL	T6,A0,0x2
LUI	AT,8011
ADDU	AT,AT,T6
LW	T6,62A8 (AT)
JR	T6
NOP
8005A094	returns: V1=0 if a.m.	fries: T7
LUI	T7,8013
LBU	T7,6FBE (T7)	;T7=hours
SLTI	AT,T7,000C
BEQ	AT,R0,8005A0B0
NOP
BEQ	R0,R0,8005A148
OR	V1,R0,R0
//8005A0B0:
BEQ	R0,R0,8005A148
ADDIU	V1,R0,0001
8005A0B8	# hours - tens place
LUI	V1,8013
LBU	V1,6FBE (V1)
SLTI	AT,V1,000C
BNEL	AT,R0,8005A0D4
ADDIU	AT,R0,000A
ADDIU	V1,V1,FFF4
ADDIU	AT,R0,000A
//8005A0D4:
DIV	V1,AT
MFLO	V1
BEQ	R0,R0,8005A14C
OR	V0,V1,R0
8005A0E4	# hours - ones place
LUI	V1,8013
LBU	V1,6FBE (V1)
SLTI	AT,V1,000C
BNEL	AT,R0,8005A100
ADDIU	AT,R0,000A
ADDIU	V1,V1,FFF4
ADDIU	AT,R0,000A
//8005A100:
DIV	V1,AT
MFHI	V1
BEQ	R0,R0,8005A14C
OR	V0,V1,R0
8005A110	# minutes - tens place
LUI	V1,8013
LBU	V1,6FBD (V1)
ADDIU	AT,R0,000A
DIV	V1,AT
MFLO	V1
BEQ	R0,R0,8005A14C
OR	V0,V1,R0
8005A12C	# minutes - ones place
LUI	V1,8013
LBU	V1,6FBD (V1)
ADDIU	AT,R0,000A
DIV	V1,AT
MFHI	V1
BEQ	R0,R0,8005A14C
OR	V0,V1,R0
//8005A148	return
OR	V0,V1,R0
JR	RA
NOP

*********REWRITE*********
8005A070	0x85F0	selects one of 5 time retrieval routines
	calls specific one from table at 801162A8
	accepts: A0=time value to grab
	returns: V0=variable
	fries: AT,V1,T6 (T7 with option 0)
2C810005	SLTIU	AT,A0,0005
10200026	BEQ	AT,R0,8005A148
00001025	OR	V0,R0,R0
00041080	SLL	V0,A0,0x2
3C018011	LUI	AT,8011
00220821	ADDU	AT,AT,V0
8C2162A8	LW	AT,62A8 (AT)
00200008	JR	AT
3C028013	LUI	V0,8013
//8005A094	returns: V1=0 if a.m.	fries: T7
90426FBE	LBU	V0,6FBE (V0)	;T7=hours
2842000C	SLTI	V0,V0,000C
1000001C	BEQ	R0,R0,return
38420001	XORI	V0,V0,0001
//8005A0A4	# hours - tens place
90426FBE	LBU	V0,6FBE (V0)
2841000C	SLTI	AT,V0,000C
50200001	BEQL	AT,R0,+1
2442FFF4	ADDIU	V0,V0,FFF4	;when past noon, subtract 12
50400001	BEQL	V0,R0,+1	;if hours=0, use 12 instead
2402000C	ADDIU	V0,R0,000C
2401000A	ADDIU	AT,R0,000A
0041001A	DIV	V0,AT
10000012	BEQ	R0,R0,return
00001012	MFLO	V0
//8005A0CC	# hours - ones place
90426FBE	LBU	V0,6FBE (V0)
2841000C	SLTI	AT,V0,000C
50200001	BEQL	AT,R0,+1
2442FFF4	ADDIU	V0,V0,FFF4	;when past noon, subtract 12
50400001	BEQL	V0,R0,+1	;if hours=0, use 12 instead
2402000C	ADDIU	V0,R0,000C
10000008	BEQ	R0,R0,return-2
2401000A	ADDIU	AT,R0,000A
//8005A0EC	# minutes - tens place
90426FBD	LBU	V0,6FBD (V1)
2401000A	ADDIU	AT,R0,000A
0041001A	DIV	V0,AT
10000005	BEQ	R0,R0,return
00001012	MFLO	V0
//8005A100	# minutes - ones place
90426FBD	LBU	V0,6FBD (V0)
2401000A	ADDIU	AT,R0,000A
0041001A	DIV	V0,AT
00001010	MFHI	V0
//8005A110	return
03E00008	JR	RA
00000000	NOP

***iMPORTANT nOTE***
if for some reason it refuses to work on console, 
it may be because the the MFLO/MFHI commands are on branches like that
not sure if its allowed by the processor

801162A8 TABLE:	0xC4828
8005A094
8005A0A4
8005A0CC
8005A0EC
8005A100

=_=

message board post# and date
803B8E18:	C-727260+1048	create and write post# to screen
ADDIU	SP,SP,FFC0
SW	RA,003C (SP)
SW	A0,0040 (SP)
SW	A2,0048 (SP)
SW	A3,004C (SP)
LUI	A0,803C
ADDIU	A0,A0,9788	;A0=803B9788: target
ADDIU	A2,R0,0002	;A2=max strlen
OR	A3,R0,R0	;A3=normal write
JAL	8009264C
SW	R0,0010 (SP)	;max strlen=min width (aligned right, not left)
//803B8E44:
LUI	AT,3F40
MTC1	AT,F0
LWC1	F4,004C (SP)
LUI	A1,803C
ADDIU	T6,R0,00FF
ADDIU	T7,R0,00FF
SW	T7,0020 (SP)
SW	T6,001C (SP)
ADDIU	A1,A1,9788	;A1=803B9788: string to display
LW	A0,0040 (SP)
ADDIU	A2,R0,0005	;A2=strlen
LW	A3,0048 (SP)
SW	R0,0014 (SP)
SW	R0,0018 (SP)
SW	R0,0024 (SP)
SW	R0,0028 (SP)
SW	R0,0034 (SP)
SWC1	F4,0010 (SP)
SWC1	F0,002C (SP)
JAL	80090E98	;print text to screen
SWC1	F0,0030 (SP)
//803B8E98:
LW	RA,003C (SP)
ADDIU	SP,SP,0040
JR	RA
NOP

retain the spacing to avoid having to overwrite the right column when switching between 2-digit and 1-digit numbers
Yeah, that's lazy.  Guess how much I care ;*)
"Post ##"
803B8E30:	ADDIU	A0,A0,9788	->	978D
803B8E6C:	ADDIU	A2,R0,0005	->	0007

order of date will need to be switched about
That's as easy as changing the target addresses ;*)
Will do "month-day-year"
803B8EA8:	C-727260+10D8	create and write date to screen
ADDIU	SP,SP,FFC0
SW	RA,003C (SP)
SW	A0,0040 (SP)
SW	A1,0044 (SP)
SW	A2,0048 (SP)
SW	A3,004C (SP)
//803B8EC0:	year
LW	T6,0044 (SP)
LUI	A0,803C
ADDIU	T7,R0,0001
LHU	A1,0006 (T6)
SW	T7,0010 (SP)
ADDIU	A0,A0,9790	->	9796
ADDIU	A2,R0,0004
JAL	8009264C
OR	A3,R0,R0
//803B8EE4:	month
LW	T8,0044 (SP)
LUI	A0,803C
ADDIU	T9,R0,0001
LBU	A1,0005 (T8)
SW	T9,0010 (SP)
ADDIU	A0,A0,9795	->	9790
ADDIU	A2,R0,0002
JAL	8009264C
OR	A3,R0,R0
//803B8F08:	day
LW	T0,0044 (SP)
LUI	A0,803C
ADDIU	T1,R0,0001
LBU	A1,0003 (T0)
SW	T1,0010 (SP)
ADDIU	A0,A0,9798	->	9793
ADDIU	A2,R0,0002
JAL	8009264C
OR	A3,R0,R0
//803B8F2C:	go on to display it
...

=_=

character text bubbles:
800A3220 calls all the stuff to assemble character text balloons and text
	given by a redirect through 800A33D8
800A29B0 sets the screen position for character text balloons
	(skip this and it will be centered on-screen)
800A2CE4 constructs the text balloons when you set A2=1
800A2D14	set color of main text balloon
800A2D7C	sets the RDP jump command, sending you to the balloon DL
	8010A7C0 is the balloon DL in question
800A2EAC	sets the main text body into the balloon
	80117298	3A83126F	unknown.  >1 removes text
	800A2F3C	3C0142C0	x position of text	->42CC

	800A29B4 dictates y position of all balloons
	800A29D0 dictates x position of all balloons

so, pulled windows left and right 0x70, then set text x to 102

moved advance arrow to center of screen
x pos	160.0	43200000
y pos	150.0	43160000
0x51218	800A2C98:	3C064320	00000000
0x5122C	800A2CAC:	3C074316

centered 'All Done' message
C-7285A0+6B2	42C0->42E8

=_=

+-+
Balloons
Yeah, they also will need to get the real string length

walkaround bubbles:
801446A0 is the working buffer for this data
0x0	4	[float] 
0x4	4	[float] 
0x8	4	[float] 
0xC	4	[float] 
0x10	4	[float] 
0x14	4	[float] bubble width percentage; also used to center text
0x18	2	bubble state counter; could maybe get away with a single byte...
0x1A	2	item #
0x1C	1	0-4	bubble state; offset in 80117B40 pointer table
	0	blank
	1	minibubble 1
	2	minibubble 2
	3	open: grow to full
	4	close: dissolve to blank
0x1D	A	string
0x27	1	TRUE when resizing bubble

//800CC320:	rips the string and does stuff to it
SH	T9,001A (T0)
JAL	80096740	;copy item A1's name to A0
LHU	A1,0042 (SP)
LUI	A0,8014
ADDIU	A0,A0,46BD	;A0=801446BD: start of string
ADDIU	A1,R0,000A	;max string length
JAL	8009C1C0	;returns V0=actual strlen
ADDIU	A2,R0,0020	;possibly a space.  could be a take on strtok
//800CC340:
MTC1	V0,F18
LUI	AT,4000	;AT=2.0
MTC1	AT,F6
CVT.S.W	F4,F18	;F4=#chars in string
LUI	AT,4100	;AT=8.0
MTC1	AT,F8
LUI	T0,8014
ADDIU	T0,T0,46A0
SUB.S	F10,F4,F6	;F10=#chars-2.0
DIV.S	F16,F10,F8	;F16=(#chars-2.0) / 8.0	ends fit in caps.  F16=amount you need to shrink balloon so text fits centered
SWC1	F16,0014 (T0)	;F16->801446B4
BEQ	R0,R0,800CC378
LBU	A0,001C (T0)	;A0=typie-thingie?
//800CC374:
SH	R0,001A (T0)	;kill the item otherwise
BEQL	A0,R0,800CC3E0
LW	RA,001C (SP)
JAL	80087C88
	LUI	T6,8014
	LW	T6,A248 (T6)
	LHU	V0,0000 (T6)
	JR	RA
	NOP
NOP
LUI	T0,8014
ANDI	T1,V0,F000
BNEZ	T1,800CC3B0
ADDIU	T0,T0,46A0	;T0=801446A0
JAL	8007D7BC
NOP
//800CC3A0:

I'm more interested in how that 0x14 value is used...
This does balloon width
//800CC584:
LUI	AT,8014
LWC1	F14,46A8 (AT)	;F14=801446A8: 1.0
LUI	AT,8011
LWC1	F8,7B64 (AT)	;F8=80117B64: 0.666667
LUI	AT,8014
LWC1	F10,46B4 (AT)	;F10=801446B4: value
LUI	AT,8011
LWC1	F18,7B68 (AT)	;F18=0.333333
MUL.S	F16,F8,F10	;F16=value * 0.666667
MFC1	A2,F14
ADDIU	A3,R0,0001
ADD.S	F4,F16,F18	;F4=(value * 0.666667) + 0.333333
MUL.S	F12,F4,F14	;F12=1.0 * F4
JAL	800E041C
NOP

again at:	does text positioning
//800CC908:
MTC1	AT,F0	;F0=[0.875]
LUI	AT,42D6
MTC1	AT,F10	;F10=107.0
LUI	AT,3F80
MTC1	AT,F18	;F18=1.0
LWC1	F8,0000 (V0)	;F8=801446A0: 54.08963
LWC1	F4,0014 (V0)	;F4=801446B4: value
LUI	AT,422C
ADD.S	F16,F8,F10	;F16=161.0896
MTC1	AT,F8	;F8=43.0	half the bubble's width (full would offset to center)
LUI	AT,42E2
SUB.S	F6,F18,F4	;F6=1.0-value
LWC1	F4,0004 (V0)	;F4=801446A4: -39.70232
LUI	A1,8014
ADDIU	T3,R0,002D
MUL.S	F10,F6,F8	;F10=(1.0-value) * 43.0
MTC1	AT,F6	;F6=113.0
LUI	AT,437F
ADDIU	T4,R0,002D
ADDIU	T5,R0,0023
ADD.S	F8,F4,F6	;F8=-39.70232 + 113.0=73.29769
ADDIU	T7,R0,0001
SW	T7,0034 (SP)	;1->SP+0x34
//800CC964:
ADD.S	F18,F16,F10	;F18=161.0896+(1.0-value) * 43.0
MTC1	AT,F16	;F16=255.0
SWC1	F8,0010 (SP)	;73.29769->SP+10
SW	T5,001C (SP)	;23->SP+1C
MUL.S	F10,F16,F2	;F10=255 * 1
MFC1	A3,F18	;A3=converted value	x=position of text on-screen
SW	T4,0018 (SP)	;2D->SP+18
SW	T3,0014 (SP)	;2D->SP+14
ADDIU	A1,A1,46BD	;A1=801446BD: item text to appear
LW	A0,00B8 (SP)	;A0=[80229050]
ADDIU	A2,R0,000A	;forced strlen = 10
TRUNC.W.S	F18,F10	;F18=FF
SW	R0,0024 (SP)
SW	R0,0028 (SP)
SWC1	F0,002C (SP)	;0.875->SP+2C
MFC1	T8,F18
SWC1	F0,0030 (SP)	;0.875->SP+30
JAL	80090E98	;print text to screen
SW	T8,0020 (SP)	;FF->SP+20
//800CC9B0:
LW	RA,0044 (SP)
LW	S0,0040 (SP)
ADDIU	SP,SP,00B8
JR	RA
NOP

What's happening is this:
The bubble will always be big enough for two characters.
 The expandable body of the bubble is sized for up to 8 more
 So, you grab half the number of characters and divide by 8 to determine the percentage you need to inflate the balloon
The text is set to appear at the edge of the balloon when expanded to full width
 If it is smaller, it gets offset up to 67 spaces right
 the ratio is 8.375, or 8 3/8 per char

What that basically means is that the routine:
1) will be kaput for longer strings	no it won't.  multipliers, duh.
2) has to be completely rewritten from scratch
to get it perfect:
1) should get width of string
2) use a multiplier against string width to get balloon size
3) offset string magically

incidentally, the byte right after the text displayed is used by something
otherwise, there doesnt' +seem+ to be anything used for next 12 bytes (0xC)

thing that first uses that redirectional byte thingy
//800CC030:	uses 0x1C byte.  
LUI	T0,8014
ADDIU	T0,T0,46A0
LBU	A1,001C (T0)
SH	V0,0042 (SP)	;save item#
SLTIU	AT,A1,0005
BEQ	AT,R0,800CC1A4
OR	A0,A1,R0
SLL	T8,A1,0x2	;T8=byte->offset
LUI	AT,8011
ADDU	AT,AT,T8
LW	T8,7B40 (AT)	;80117B40: 800CC064,800CC094,800CC094,800CC0C0,800CC120
JR	T8
NOP

Oh, did I mention...
They have a +completely different+ set of code for the balloons in the inventory ;*)
Kimi doesn't like them.  Not one bit.

803C5738: the 4140 here is used to offset descriptive text in the inventory
	ie. package to/from lines, etc

803C685C starts the horrors of its text bank, just like the package thing
not as bad really.  The text and edge of baloon are static.  Just right edge extends out (hopefully)
80145300 stows p->s to a slew of DLs
0x0		?
0x4	4	p->start
0x8	4	p->end
0xC	4	p->? max ?


+-+
FOR THE RECORD, smoosh the "Set Clock" text bubble a little
also, smoosh the text bubble for name, or make string more intricate
for clock, will just extend text.
New table reads:	C-71DCE0
previous	new
803B8E10	803B8E10	"Set Clock Time"
803B8E19	803B8E1F	"20    Y      M      D"
803B8E30	803B8E34	":"
803B8E34	803B8E35	"OK!"
803B8844	0xA74	ADDIU	A2,R0,0009	->	000E
803B8884	0xAB4	ADDIU	A1,A1,8E19	->	8E1F
803B88E8	0xB18	ADDIU	A1,A1,8E30	->	8E34
803B8A20	0xC50	ADDIU	A1,A1,8E34	->	8E35

in its binaries:	C-71DCE0
803B81D8:	0x408	allow dates > 2030
240D0001	ADDIU	T5,R0,0001	->	0000	;min date
2981001F	SLTI	AT,T4,001F	->	0064	;max year: 2100
5420001B	BNEL	AT,R0,803B8250
27A40034	ADDIU	A0,SP,0034
10000018	BEQ	R0,R0,803B824C
A7AD0028	SH	T5,0028 (SP)

803B8208	BLEZ	A0,803B822C	->	04800008	BLTZ	A0,803B822C
803B8218
3328FFFF	ANDI	T0,T9,FFFF	->	00194025	OR	T0,R0,T9
1D00000B	BGTZ	T0,803B824C	->	0501000B	BGEZ	T0,803B824C
2409001E	ADDIU	T1,R0,001E	->	0063	;max year 2099
10000009	BEQ	R0,R0,803B824C
A7A90028	SH	T1,0028 (SP)


803B8770-803B8AA4	writes all text (including year) on 'set time' dialog
in particular:
803B892C:	displays the editable values on date setting dialog
27B30098	ADDIU	S3,SP,0098
96250000	LHU	A1,0000 (S1)
240F0001	ADDIU	T7,R0,0001
AFAF0010	SW	T7,0010 (SP)	;this is what sets it to display 0s
02602025	OR	A0,S3,R0
24060002	ADDIU	A2,R0,0002
0C024993	JAL	8009264C
00003825	OR	A3,R0,R0

//803B820C	decrement time on set clock doohick
ADDIU	T9,A0,FFFF
BNEZ	V1,803B822C
SH	T9,0000 (V0)
OR	T0,R0,T9
BGEZ	T0,803B824C
ADDIU	T1,R0,0063


=_=

Name entry page!
80126EC0	string typed into name dialog

803B97A4:		append character if not a return or EOL
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
LBU	T6,0013 (A0)	;T6=char
ADDIU	AT,R0,00CD
BEQL	T6,AT,803B97D8
LW	RA,0014 (SP)
LH	T7,0018 (A0)	;T7=max strlen
LH	T8,001C (A0)	;T8=cur strlen
BEQL	T7,T8,803B97D8	;skip if max size
LW	RA,0014 (SP)
JAL	803B973C
NOP
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

803B973C:		write newly-entered character to string buffer
LH	V1,001C (A0)	;V1=count?	A0=803BC500
LH	A2,0016 (A0)	;A2=count?
LW	T6,0024 (A0)	;T6=80126EC0: string
OR	A1,V1,R0	;A1=V1=count?
SLT	AT,A2,V1	;
BEQ	AT,R0,803B977C
ADDU	V0,T6,V1
LBU	T7,FFFF (V0)
//803B975C:
ADDIU	A1,A1,FFFF
ADDIU	V0,V0,FFFF
SB	T7,0001 (V0)
LH	A2,0016 (A0)
SLT	AT,A2,A1
BNEL	AT,R0,803B975C
LBU	T7,FFFF (V0)
LH	V1,001C (A0)
//803B977C:	append character to string
LBU	T0,0013 (A0)	;T0=char
ADDIU	T8,A2,0001	;T8=count++?
ADDIU	T9,V1,0001	;T9=count++?
SH	T8,0016 (A0)
SH	T9,001C (A0)
ADDIU	T1,R0,0001
SB	T0,0000 (V0)	;char->string
SB	T1,0015 (A0)	;1->803BC515
JR	RA
NOP

fine, fine.  The pertinent stuff...
//803B83D0:	part of the writing-stuff-to-screen code
SW	R0,0034 (SP)	;this sets the text render mode to var.
SW	R0,0028 (SP)
SW	R0,0024 (SP)
LW	A0,0094 (SP)
SWC1	F20,002C (SP)
JAL	80090E98	;A1 points to the 'Set %BLAH% Name' string in m_ledit_ovl
SWC1	F20,0030 (SP)

//803B83EC:
LWC1	F8,0074 (SP)
LW	T4,0088 (SP)
LW	A1,0024 (S4)
LH	A2,0018 (S4)
SWC1	F8,0010 (SP)
LBU	T6,001C (T4)
ADDIU	T9,R0,00FF	;T9=black text?  Probably colored later with RDP-bgcolor
LW	A0,0094 (SP)
SW	T6,0014 (SP)
LBU	T7,001D (T4)
LW	A3,0078 (SP)
SW	T7,0018 (SP)
LBU	T5,001E (T4)
SW	R0,0034 (SP)
SWC1	F24,0030 (SP)
SWC1	F24,002C (SP)
SW	R0,0028 (SP)	;I don't think this would have changed...
SW	R0,0024 (SP)	;I don't think this would have changed...
SW	T9,0020 (SP)	;likewise...
JAL	80090E98	;print text to screen
SW	T5,001C (SP)	;likewise
//803B8440

BACKTRACE!
routes this around:
80090E98,80090CC0,80091E0C,80091C98,800918A8,800917C8,8009028C
80090CC0	
	SP-=F0; SP+118 = SP+28 from caller [770]
	80090D64	if SP+118!=0, set fixed-width
80091AB0	A3->SP+54, stored again to S0+8
	80091B88	if S0+8 &1 !=0, then it sets fixed-width
800915D8	A3=mode thingy

FIX!  lets hope it always returns V1=1 ;*)
C-71EAF0+65C	
803B842C:	AFA30028	SW	V1,0028 (SP)	;I don't think this would have changed...

Silly superficial stuff:
"Your Name?"
x:	430E0000	142.0
"Town's Name?"
x:	43080000	136.0

=_=
script problems!
first, anything over 0x400 needs to be shortened or split
second, you can't leave blank entries!  fill with [close] or something

characters are drawing their 7F1C names from the original string bank somehow...
...or the stuff was written into the save file, which is highly probable
string+7D	F1 17
string+247	F1 AB AB BD
string+27B	F1 5B C3


=_=

text entry dial!
803B8B50:	C-71F4E0+0	pull pointer to text and #s
90830004	
3C0F803C	
3C18803C	
10600004	
00000000	
24010002	
1461000B	
00A62021	
10E00005	
00A62021	
00800821	
00042080	
10000005	
00812021	
00057080	
01C57021	
10000001	
01C62021	
00032880	
01E57821	
8DEFBFEC	
0305C021	
8F18BFD8	
008F001A	
15E00002	
00000000	
0007000D	
2401FFFF	
15E10004	
3C018000	
14810002	
00000000	
0006000D	
00002010	
0304C821	
93220000	
03E00008	
00000000	


803BBF10	Hana	follows outer track order
803BBF44	Kana	follows outer track order
803BBF78	@_@
803BBF98	numbers
803BBFA4	ASCII

803BBFC4	A
803BBFC8	1E
803BBFCC	A
803BBFD0	1E
803BBFD4	A
803BBFD8	p->Hana
803BBFDC	p->@_@
803BBFE0	p->Kana
803BBFE4	p->ASCII
803BBFE8	p->numbers
803BBFEC	32	# in Hana
803BBFF0	1E	# in @_@
803BBFF4	32	# in Kana
803BBFF8	1E	# in ASCII
803BBFFC	A	# in numbers

803BC504	language selected
set by:
//803B92BC:	+76C
SB	R0,0004 (V1)
SB	R0,0005 (V1)
SH	T8,0006 (V1)
maybe to:
24190300	ADDIU	T9,R0,0300
A4790004	SH	T9,0004 (V1)
A4780006	SH	T8,0006 (V1)

yeah, its cheap, but it is easier than THIS!
(oh, do need to disable the outer track)
803BBFD8	803BBFA4	p->ASCII
803BBFE0	803BBF98	p->numbers
803BBFE4	803BBF10	p->Hana
803BBFE8	803BBF44	p->Kana
803BBFEC	1E	# in ASCII
803BBFF4	A	# in numbers
803BBFF8	32	# in Hana
803BBFFC	32	# in Kana

sets order of entries!
803BC2DC	0C001440	Hana
803CC2E0	0C0015A0	@_@
803CC2E4	0C001498	Kana
803CC2E8	0C0014F0	ASCII
803CC2EC	0C001548	numbers

//803B8B50:	
LBU	V1,0004 (A0)
LUI	T7,803C
LUI	T8,803C
BEQ	V1,R0,803B8B70
NOP
ADDIU	AT,R0,0002
BNE	V1,AT,803B8B98
ADDU	A0,A1,A2
revise for ASCII,#,@_@,hana,kana
	LBU	V1,0004 (A0)
	LUI	T7,803C
	LUI	T8,803C
	NOP
	NOP
2461FFFE	ADDIU	AT,V1,FFFE
1820000B	BLEZ	AT,803B8B98
	ADDU	A0,A1,A2

//803B9024:	this does the dials, obviously ;*)
LBU	V0,0004 (A1)
ADDIU	AT,R0,0002
BEQL	V0,R0,803B9040
LH	T6,0006 (A1)
BNEL	V0,AT,803B9090
OR	V0,R0,R0
//803B903C:	red dial selection thingy!
LH	T6,0006 (A1)
revise for ASCII,#,@_@,hana,kana
	LBU	V0,0004 (A1)
2441FFFE	ADDIU	AT,V0,FFFE
58200018	BLEZL	AT,803B9090
00001025	OR	V0,R0,R0
	NOP
	NOP

//803B90C0:	letters on face
BEQ	V0,R0,803B90D0
ADDIU	AT,R0,0002
BNEL	V0,AT,803B90EC
LH	V0,0006 (A0)
LH	T6,0006 (A0)
revise for ASCII,#,@_@,hana,kana
2441FFFE	ADDIU	AT,V0,FFFE
58200009	BLEZL	AT,803B90EC
84820006	LH	V0,0006 (A0)
	NOP

//803BAB08:	DL manipulation
LW	T1,013C (SP)
LUI	T0,E700
BEQ	T1,R0,803BAB1C
ADDIU	AT,R0,0002
BNE	T1,AT,803BABDC
OR	V0,A2,R0
revise for ASCII,#,@_@,hana,kana
	LW	T1,013C (SP)
	LUI	T0,E700
2521FFFE	ADDIU	AT,T1,FFFE
18200031	BLEZ	AT,803BABDC
00C01025	OR	V0,A2,R0
	NOP




-------

all the save dialogs are WrOnG!	[menu 01AE 01AF]
2B09	->2B0A + 2B0B
2B0C	->2B0D + 2B0E
2B0F	->2B10 + 2B11
2B12	->2B13 + 2B14
2B15	->2B16 + 2B17
2B18	->2B19 + 2B1A

set via lists: C-85DB00	0096C3A0 0096CC00	pcv->80AAC230
0x83C	802745EC	00002B09
0x840	802745F0	00002B0C
0x844	802745F4	00002B0F
0x848	802745F8	00002B12
0x84C	802745FC	00002B15
0x850	80274600	00002B18

load textID to:
80139F40	
80141FF4	currently-displayed text (header for msgtxt)
801426F4	

okay, this is stupid.  Just hack the text!

+-+-+-+-+
About mail and message board messages:
They're broken.
mail at: 80004948
currently reading: 803CB788

  The physical limit on text for the message itself is 0x68.  
  That's tested at 80093954:	mail
SLTI	AT,V1,0069
BEQ	AT,R0,80093980
LW	T2,004C (SP)

  Like all text banks, it will fail to load if the text exceeds this total
  Until a better workaround can be made (aka a huge freaking buffer or variable size) I'll just force messages to diminish in size
!TEMPORARY WORKAROUND!	80093954	mail
28610069	SLTI	AT,V1,0069
50200001	*BEQL	AT,R0,+1
24030068	*ADDIU	V1,R0,0068

800B3398:
BEQL	V0,R0,800B33A0
LW	RA,0014 (SP)
SLTI	V0,V1,0069
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

800B5AF4:
SLTI	A1,A0,0069
BEQL	A1,R0,800B5B0C
OR	V0,R0,R0
BEQ	R0,R0,800B5B0C
LW	V0,C538 (V0)

=_=

Hey!  Guess what?  ...the Gyroid message cursor uses a +different+ codebase than the other message cursor.  Joy!

=_=

Empty character slot
C-7C8B40+0xC30
LUI	A1,809C
ADDIU	A1,A1,0C38	;A1=p->text string
SW	A0,003C (SP)
JAL	800998C0
ADDIU	A2,R0,0004	;A2=strlen

0x2518	string

string itself means soemthing like vacant, but in this case, New as in new file would be more fitting

=_=

offsets to selection text
0x9D60	Are you
text:		8DF4	24A59070	->	906D
strlen:	8DF8	24060004	->	7

0x9D64	certain?
text:		8E58	24A59074	->	
strlen:	8E60	24060006	->	8

=_=

801426D4 is next-loaded text
determine the mail return texts
Pelly:
greetings	80272D30
08AD	greeting - mailbag full
08B1	greeting
08CF	greeting - no loan, mailbag full
08D1	greeting - no loan
08AF	mailbag full

08B5	send a letter
08B9	sent
08BB	special delivery (slogan)
08BD	any more to send?
08E3	not mailing menu
08E1	
1BD7	

08D3	repay loan
08D5	amount remaining
08D7	paid off
08E5	return w/o payment

1BE7	normal save a letter
08E9	return from save a letter

08D9	anything else? - mailbag full
08DB	anything else?
08DD	anything else? - no loan, mailbag full
08DF	anything else? - no loan
08B3	normal end

007D	

1BDB	!!!
	1BDD	yes	appears to save game!
	1BDF	never mind
08E7	text...	probably corrupt or unreadable
1BD3	can't accept letters from travellers
08EB	menu: 1BE7, 08ED
	1BE7	pretext to saving letters
	08ED	text...
1BD9	!!!
	08E9	yes
	08ED	never mind

0019	!!!
0016	!!!
0014	!!!

0012	!!!	does this ask the quality of the service?
	000D	happy!	
	000E	sleepy	
	0009	next!	
		000A	about average	
		000B	mad
		000C	disappointing
		0012	next!
	options redirect to 0003, then 0002
		FFFF	end
		0004	continue
0019	!!!
0016	!!!
0015	!!!


Phylis:
08AE	greeting - mailbag full
08B2	greeting
08D0	greeting - no loan, mailbag full
08D2	greeting - no loan
08B0	mailbag full

08B6	send a letter
08BA	sent
08BC	special delivery
08BE	any more to send?
08E4	not mailing menu
08E2	
1BD8	

08D4	repay loan
08D6	amount remaining
08D8	paid off
08E6	return w/o payment

1BE8	normal save a letter
1BDA	!!!
	08EA	yes
	08EE	never mind
1BDC	!!!
	1BDE	yes	appears to save game!
	1BE0	never mind


08DA	anything else? - mailbag full
08DC	anything else?
08DE	anything else? - no loan, mailbag full
08E0	anything else? - no loan
08B4	normal end

+-+-+

Train:
0943	greeting
	094A	yes
	+094B	prepare for departure
	+094F	copying data
	0944	no

0948	not enough space
	094D	yes
	094C	no
	
095E	No MemPak present

+-+-+

catalog screen side column onmouseover names
relocated to 8B5A	-	0x5A

temporary fix for postscript runover - 
	copy length fixed at 0x10 (more doesn't get copied anyway)
	requires a sie reduction in the copy half of postscript retrieval service
	80093D28 and down... A1 (SP+78) = strlen
	
	could do 80093D58 BGTZL, so only writes if V0 (countdown->0)
	then hijack 80093D3C - if you can get a 'A1!>10' in there
	could rewrite loop into decremental count...
	wait! does S0 always = 10?
	
Try...
80093D38:	PREPARE SLOT	
NOTE: this is intentionally written unoptimized to keep from having to recompute all the branches
	It is designed as a temporary measure until the whole recall scheme is revised
OR	V0,R0,R0	2402FFFF	ADDIU	V0,R0,FFFF
BLEZ	A1,80093D60	18A0000B	BLEZ	A1,+B
ADDU	A0,T9,T2	032A2021	ADDU	A0,T9,T2
LBU	T4,0000 (A0)	00B0082A	SLT	AT,A1,S0
ADDIU	V0,V0,0001	50200001	BEQL	AT,R0,+1
SLT	AT,V0,A1	02002825	OR	A1,S0,R0
ADDIU	V1,V1,0001	908C0000	LBU	T4,0000 (A0)
ADDIU	A0,A0,0001	24840001	ADDIU	A0,A0,0001
//80093D58
BNEZ	AT,80093D44	24420001	ADDIU	V0,V0,0001
SB	T4,FFFF (V1)	00430821	ADDU	AT,V0,V1
SLT	AT,V0,S0	1445FFFB	BNE	V0,A1,-5
BEQ	AT,R0,80093D84	A02CFFFF	SB	T4,FFFF (AT)
OR	A1,S0,R0	10500006	BEQ	V0,S0,+6
//80093D6C
ADDIU	A0,R0,0020	02002825	OR	A1,S0,R0
ADDIU	V0,V0,0001	240C0020	ADDIU	T4,R0,0020
SLT	AT,V0,S0	24420001	ADDIU	V0,V0,0001
SB	A0,0000 (V1)	00430821	ADDU	AT,V0,V1
BNEZ	AT,80093D70	1445FFFD	BNE	V0,A1,-3
ADDIU	V1,V1,0001	A02CFFFF	SB	T4,FFFF (AT)
//80093D84:

messages are a problem...
maybe can take current message and display it from a buffer elsewhere
Use three new 7F commands (or similiar) to act as pure rom upload
So, a postscript might just recall a line of text 32 characters long
	but itself only be as long as the 7F to recall it

+_+

Snowman freeze bug is based on general mail message freeze bug.
Basically, all 7F commands besides slot insert fail.
Simplest solution would be to simply omit all the other commands.  However, I'm not a simple guy.

Add an alternate return: V1=offset to text
8009341C	4199C	
ADDIU	SP,SP,FFE0
SW	RA,001C (SP)
ADDU	T6,A2,A0	;T6=A2+A0: p->cur.text.pos.
LBU	V0,0001 (T6)	;V0=text+1: command ID
BLTZ	V0,80093464	;branch if invalid (negative)
SLTI	AT,V0,0061	;TRUE if ID 0-61, which were normal, stock commands
BEQ	AT,R0,80093464	;branch if not one of these
SLL	T7,V0,0x2	;T7=command->offset
LUI	V1,8010
ADDU	V1,V1,T7
LW	V1,7020 (V1)	;V1=80107020+offset: p->expansion handler when applicable
LW	T8,0030 (SP)
BEQL	V1,R0,80093468	;branch if not a handled insert type
OR	V0,A3,R0
JALR	RA,V1		;insert!
SW	T8,0010 (SP)	;SP+10=T8: ???
BEQ	R0,R0,8009346C
LW	RA,001C (SP)
//80093464:	default to given sample
OR	V0,A3,R0	;V0=A3: default return
//80093468:	return
LW	RA,001C (SP)
ADDIU	SP,SP,0020
JR	RA
NOP

hacked!
8009341C	4199C	
27BDFFD8	*ADDIU	SP,SP,FFD8
AFBF001C	SW	RA,001C (SP)
00C47021	ADDU	T6,A2,A0	;T6=A2+A0: p->cur.text.pos.
91C20001	LBU	V0,0001 (T6)	;V0=text+1: command ID
2C410061	*SLTIU	AT,V0,0061	;removes need for < 0 test
10200009	BEQ	AT,R0,80093464
00027880	SLL	T7,V0,0x2
3C038010	LUI	V1,8010
006F1821	ADDU	V1,V1,T7
8C637020	LW	V1,7020 (V1)
10600004	*BEQ	V1,R0,80093464
8FB80030	LW	T8,0030 (SP)
0060F809	JALR	RA,V1
AFB80010	SW	T8,0010 (SP)
00023825	*OR	A3,V0,R0	;A3=size
//80093464:
AFA70020	*SW	A3,0020 (SP)	;save position
0C0240D3	*JAL	8009034C	;get command size
000E2025	*OR	A0,T6,R0
00021825	*OR	V1,V0,R0	;V1=command size, for offsetting
8FA20020	*LW	V0,0020 (SP)
//80093468:
8FBF001C	LW	RA,001C (SP)
03E00008	JR	RA
27BD0028	*ADDIU	SP,SP,0028

used here:
//800934BC:
	LBU	V0,0000 (S2)
	OR	A0,S4,R0	;A0=S4: p->text
	OR	A1,S5,R0	;A1=S5: max size?
	BNE	S3,V0,800934E4	;branch if not a 7F command
	OR	A2,S0,R0	;A2=S0: cur.pos
	OR	A3,S1,R0	;A3=S1: default return=endpoint
	JAL	8009341C	;V0=size of file; injects 7F slot commands
	SW	S6,0010 (SP)	;SP+10=S6: ???
	BEQ	R0,R0,800934EC
	OR	S1,V0,R0	;S1=V0: endpoint=new size
//800934E4:
	ADDIU	S0,S0,0001	;S0++	count++
	ADDIU	S2,S2,0001	;S2++	source++
	SLT	AT,S0,S1	;TRUE if counted past end
	BNEL	AT,R0,800934C0
	LBU	V0,0000 (S2)	;V0=next byte from source
//800934F8:

insert these and add the result to 
0C0240D3	JAL	8009034C	;get command size
00122025	OR	A0,S2,R0

hacked!
//800934BC:	41A3C
	LBU	V0,0000 (S2)
	OR	A0,S4,R0	;A0=S4: p->text
	OR	A1,S5,R0	;A1=S5: max size?
	BNE	S3,V0,800934E4	;branch if not a 7F command
	OR	A2,S0,R0	;A2=S0: cur.pos
	OR	A3,S1,R0	;A3=S1: default return=endpoint
	JAL	8009341C	;V0=size of file; injects 7F slot commands
	SW	S6,0010 (SP)	;SP+10=S6: ???
00708021	*ADDU	S0,S0,V1
10000002	*BEQ	R0,R0,800934E8
	OR	S1,V0,R0	;S1=V0: endpoint=new size
//800934E4:
	ADDIU	S0,S0,0001	;S0++	count++
	SLT	AT,S0,S1	;TRUE if counted past end
1420FFF2	*BNE	AT,R0,800934BC
02149021	*ADDU	S2,S0,S4
//800934F8:


//80093570:
LBU	V0,0000 (S2)
OR	S3,S1,R0
OR	A0,S5,R0
BNE	S8,V0,800935B4	;branch if not a 7F command
OR	A1,S6,R0
OR	A2,S0,R0
OR	A3,S1,R0
JAL	8009341C
SW	S7,0010 (SP)
LW	V1,0000 (S4)
OR	S1,V0,R0
SLT	AT,S0,V1
BEQ	AT,R0,800935BC
ADDU	T6,V1,V0
SUBU	T7,T6,S3
BEQ	R0,R0,800935BC
SW	T7,0000 (S4)
//800935B4:
ADDIU	S0,S0,0001
ADDIU	S2,S2,0001
//800935BC:
SLT	AT,S0,S1
BNEL	AT,R0,80093574
LBU	V0,0000 (S2)
//800935C8:

HACKED!
//80093570:	41AF0
	LBU	V0,0000 (S2)
	OR	S3,S1,R0
	OR	A0,S5,R0
17C200	*BNE	S8,V0,800935B4	;branch if not a 7F command
	OR	A1,S6,R0
	OR	A2,S0,R0
	OR	A3,S1,R0
	JAL	8009341C
	SW	S7,0010 (SP)
00708021	*ADDU	S0,S0,V1
	LW	V1,0000 (S4)
	OR	S1,V0,R0
	SLT	AT,S0,V1
102000	*BEQ	AT,R0,800935BC
	ADDU	T6,V1,V0
	SUBU	T7,T6,S3
100000	*BEQ	R0,R0,800935BC
	SW	T7,0000 (S4)
//800935B4:
	ADDIU	S0,S0,0001
//800935BC:
	SLT	AT,S0,S1
1420	*BNE	AT,R0,80093570
02159021	*ADDU	S2,S0,S5
//800935C8:

Fixed the snowman bug at least.  Here's hoping everything else is okay too!

+_+

Build a generic sort of codeword/size and string retrieval service.

string retrieval:
select	80065D90
item	80096740
mail	80093DA8
msg	8009E558
super	80093B28
multi	800940A8
string	800C3F70
npc	800ACCAC
ps	80093C98

codeword retrieval:
select	80065528
item	-
mail	80093878
msg	8009E388
super	800935F8
multi	80093F94
string	800C3E30
npc	-
ps	80093738

+_+

use it to set catchphrases
800AA218	set actor ID A1's character attributes (catchphrase, outfit, etc.)
	accepts: A0=p->target, A1=npc_txt ID#, A2=personality?, A3=p->NPC response entry
	ADDIU	SP,SP,FFE0
	SW	S0,0018 (SP)
	OR	S0,A0,R0	;S0=A0: p->target
	SW	RA,001C (SP)
	SW	A3,0024 (SP)	;SP+24=A3: p->NPC response table
	ADDIU	AT,R0,000E	;AT=E
	ANDI	T7,A1,F000	;T7=A1 & F000: ID type
	SRA	T8,T7,0xC	;T8=upper nibble of ID
	BNE	T8,AT,800AA28C	;return if not an npc_txt ID
	LHU	T0,0000 (A3)
//800AA240:
	SH	T0,0520 (S0)
	SH	A1,0000 (S0)
	SB	A2,000B (S0)	;Save byte -> A0+B
	ADDIU	A1,R0,0007	;A1=7: #bytes
	ADDIU	A0,S0,04E5	;A0=S0+4E5: p->target
	JAL	8009992C	;memset(A0,A1,A2)
	ADDIU	A2,R0,0020	;A2=20: ' '
//800AA25C:	copy to string
	LW	A3,0024 (SP)
	ADDIU	A0,S0,04E5	;A0=S0+4E5: p->target
	JAL	800C3F70	;retrieve string from string_txt
	LHU	A2,0002 (A3)	;A2=A3+2: index#
//800AA26C:	copy to final location
	LUI	A1,8013
	ADDIU	A1,A1,9E00
	LHU	T1,0008 (A1)	;T1=80129E08: 
	ADDIU	A0,S0,0004	;A0=SO+4:	A0=p->target [80130DBC]
	ADDIU	A2,R0,0007	;A2=strlen 7
	JAL	800998C0	;copy A2 bytes from string A1 to A0
	SH	T1,0002 (S0)	;[0]->S0+2
//800AA288:	return
	LW	RA,001C (SP)
	LW	S0,0018 (SP)
	ADDIU	SP,SP,0020
	JR	RA
	NOP

"minor" revision to set 7F6F strings for catchphrases!
800AA218	58798	set actor ID A1's character attributes (catchphrase, outfit, etc.)
	accepts: A0=p->target, A1=npc_txt ID#, A2=personality?, A3=p->NPC response entry
27BDFFE0	ADDIU	SP,SP,FFE0
AFA40018	*SW	A0,0018 (SP)	;SP+20=A0: p->target
3401E000	*ORI	AT,R0,E000	;AT=E000
AFBF001C	SW	RA,001C (SP)
30B8F000	*ANDI	T8,A1,F000	;T7=A1 & F000: ID type
17010018	*BNE	T8,AT,800AA28C	;return if not an npc_txt ID
94E80000	LHU	T0,0000 (A3)
A4880520	*SH	T0,0520 (A0)
A4850000	*SH	A1,0000 (A0)
A086000B	*SB	A2,000B (A0)	;Save byte -> A0+B
//800AA24C:	extend name and insert
94E20002	*LHU	V0,0002 (A3)	;V0=A3+2: index#
3C017F6F	*LUI	AT,7F6F
3442D000	*ORI	V0,V0,D000
00221025	*OR	V0,AT,V0
AFA20024	*SW	V0,0024 (SP)	;SP+24=V0: catchphrase index#
34022020	*ORI	V0,R0,2020
A7A20028	*SH	V0,0028 (SP)	;SP+28="  "
A7A2002A	*SH	V0,002A (SP)	;SP+28="    "
27A50024	*ADDIU	A1,SP,0024
24060007	*ADDIU	A2,R0,0007	;A2=7: #bytes
0C026630	*JAL	800998C0	;copy A2 bytes from string A1 to A0
248404E5	*ADDIU	A0,A0,04E5	;A0=S0+4E5: p->target
//800AA26C:	copy to final location
3C058013	LUI	A1,8013
8CA59E00	ADDIU	A1,A1,9E00
94A90008	LHU	T1,0008 (A1)	;T1=80129E08: 
8FA40018	*LW	A0,0018 (SP)
A4890002	*SH	T1,0002 (A0)	;[0]->S0+2
24060007	ADDIU	A2,R0,0007	;A2=strlen 7
0C026630	JAL	800998C0	;copy A2 bytes from string A1 to A0
24840004	*ADDIU	A0,A0,0004	;A0=SO+4:	A0=p->target [80130DBC]
//800AA288:	return
8FBF001C	LW	RA,001C (SP)
03E00008	JR	RA
27BD0020	ADDIU	SP,SP,0020

+_+

C-7CD7E0
80285520 is used to generate Nook's shop map position.  (As in acre blah - blittyblah)
Would prefer letter, numeral. Add +0x10 to initial result string, I think.
	ADDIU	SP,SP,FFD8
	SW	RA,001C (SP)
	SW	A0,0028 (SP)
8C850954	*LW	A1,0954 (A0)
	ADDIU	A0,SP,0027
	ADDIU	A2,R0,0001
	SW	R0,0010 (SP)
	JAL	8009264C	;A0=number A1 converted to numeral of length A2
	ADDIU	A3,R0,0001
//	inserted to convert numeral to letter
93A20027	*LBU	V0,0027 (SP)
24420010	*ADDIU	V0,V0,0010
	JAL	8009D1F0	;V0=p->text controller
A3A20027	*SB	V0,0027 (SP)
	OR	A0,V0,R0
	ADDIU	A1,R0,0001
	ADDIU	A2,SP,0027
	JAL	8009D6D0	;copy A3 bytes from string A2 to slot A1 of of text controller A0
	ADDIU	A3,R0,0001
//80285564:	sort to compress a tad better
8FA40028	*LW	A0,0028 (SP)
AC850950	*LW	A1,0950 (A0)
	ADDIU	A0,SP,0027
	ADDIU	A2,R0,0001
	SW	R0,0010 (SP)
	JAL	8009264C
	ADDIU	A3,R0,0001
	JAL	8009D1F0	;V0=p->text controller
	NOP
	OR	A0,V0,R0
	ADDIU	A1,R0,0002
	ADDIU	A2,SP,0027
	JAL	8009D6D0	;copy A3 bytes from string A2 to slot A1 of of text controller A0
	ADDIU	A3,R0,0001
//802855A0:
	LW	RA,001C (SP)
	JR	RA
	-ADDIU	SP,SP,0028

  Still won't compress.  Time to do things the stupid way!  Just add 40 and 30 to each number.
	ADDIU	SP,SP,FFD8
	SW	RA,001C (SP)
	SW	A0,0028 (SP)
8C820954	*LW	V0,0954 (A0)
24420040	*ADDIU	V0,V0,0040	;convrts number to letter all right ;*)
A3A20027	*SB	V0,0027 (SP)
	*NOP
	*NOP
	*NOP

7EB3E0 contains the Shrine's own method of spitting out map coordinates
//802948C4:
	LW	A1,0038 (SP)
	ADDIU	A2,R0,000A
	JAL	8009264C
	SW	R0,0010 (SP)
	LW	A0,004C (SP)
	ADDIU	A1,R0,0001
	ADDIU	A2,SP,0028
	JAL	8009D6D0
	ADDIU	A3,R0,000A
	ADDIU	A0,SP,0028
	LW	A1,0034 (SP)
	ADDIU	A2,R0,000A
	JAL	8009264C
	SW	R0,0010 (SP)
	LW	A0,004C (SP)
	OR	A1,R0,R0
	ADDIU	A2,SP,0028
	JAL	8009D6D0
	ADDIU	A3,R0,000A
	BEQ	R0,R0,80294930
	LW	A0,004C (SP)
	
Second job, also independant code:	7CE3F0
//8029A100:
	LUI	T8,8012
	ADDIU	T8,T8,6EA0
	SLL	T7,T7,0x3
	ADDU	V0,T7,T8
	ADDIU	A1,V0,7FFF
	LBU	A1,23FB (A1)
	SW	V0,0020 (SP)
	SW	R0,0010 (SP)
	ADDIU	A2,R0,0006
	JAL	8009264C
	ADDIU	A3,R0,0001
	LW	A0,003C (SP)
	ADDIU	A1,R0,0003
	ADDIU	A2,SP,002C
	JAL	8009D6D0
	ADDIU	A3,R0,0006
//8029A140:
...
//8029A194:
	JAL	8009D820
	ADDIU	A3,R0,0006	;actor name, so change to 8!
	
likely more of these...	
	0C024993
	0C02B346

+_+

Redoing the font system, in part to reuse the original font table, in part to correct fixed-width display, in part to make things more confusing to those who read these.
	Refer to the mess at 80091244.
Basic idea is such:
	1) Font offset data basically doesn't change.  Still gives size correction for character.
	2) All characters are centered.  Any odd pixels will be pushed to the left to ensure they appear.
	3) Returned value is actual character width.  Basically, 0xC-correction.
	4) Left offsetting is the average of 0xC-width.  
For example, with an image 9 bytes wide:
	Correction value of 3.
	Actual width is C-3 = 9.
	Left offset is (C-9)/2 = 1.
	Result source read: .+++++++++..

800911E8	3F768	prints formatted char to screen, calling 8009069C

Well, this handles one instance--small coloured balloons like character name bubbles.
On second thought, might be better to just hack it within 8009069C.
That's what returns the "base" offset value to the image that I'm offsetting above.

8009069C	3EC1C	set font tiles and return char proportions
	accepts: A0=p->DL pointer, A1=char#, A2=@image offset, A3=@line#, SP+10=@image offset edge, SP+14=@line bottom
	ADDIU	SP,SP,FFE0
	SW	RA,0014 (SP)
	SW	A0,0020 (SP)	;SP+20=A0: p->DL pointer
	SW	A1,0024 (SP)	;SP+24=A1: char#
	SW	A2,0028 (SP)	;SP+28=A2: @image offset
	SW	A3,002C (SP)	;SP+2C=A3: @line#
	LW	T6,0020 (SP)	;T6=p->DL pointer
	LW	V1,0000 (T6)	;V1=p->DL
	JAL	80090178	;V0=p->font images
	SW	V1,001C (SP)	;SP+1C=V1: p->DL
//800906C4:	settextureimage
	LW	V1,001C (SP)	;V1=p->DL
	LW	A3,0024 (SP)	;A3=char#
	OR	A0,V1,R0	;A0=V1: p->DL
	LUI	T7,FD88
	ORI	T7,T7,005F	;T7=FD88005F
	SW	T7,0000 (A0)	;DL+0=settextureimage.u: i 8bit, 0x60
	SW	V0,0004 (A0)	;DL+4=settextureimage.l: address
	ADDIU	V1,V1,0008	;V1+=8: next DL op
//800906E4:	settile
	SRA	A1,A3,0x4
	SLL	A1,A1,0x4	;A1=char & 0xF0
	SUBU	A0,A3,A1	;A0=char# & 0xF
	ADDU	AT,A0,R0	;AT=A0: lower nibble
	SLL	A0,A0,0x2
	SUBU	A0,A0,AT
	SLL	A0,A0,0x2	;A0*=C: x offset to font char
	ADDIU	A2,A0,000B	;A2=x.off + B
	SUBU	T2,A2,A0	;T2=(x.off+B)-x.off: 0xB
	ADDIU	T2,T2,0001
	SRA	T2,T2,0x1	;T2/=2, rounded up
	ADDIU	T2,T2,0007
	SRA	T2,T2,0x3	;T2/=8, rounded up
	ANDI	T2,T2,01FF	;T2&=0x1FF: ensure falls within 9 bit range used by microcode
	OR	V0,V1,R0	;V0=V1: p->DL
	SLL	T2,T2,0x9	;T2*=200: x.off -> line
	LUI	AT,F588
	LUI	T9,070C
	ORI	T9,T9,0300	;T9=070C0300
	OR	T8,T2,AT	;T8=F5880000 | line
	SW	T8,0000 (V0)	;DL+0=settile.u: i 8bit, line
	SW	T9,0004 (V0)	;DL+4=settile.l: tile 7, clamp st mirror st
	ADDIU	V1,V1,0008	;V1+=8: next DL op
//80090740:	loadsync
	OR	V0,V1,R0	;V0=V1: p->DL
	LUI	T3,E600
	SW	T3,0000 (V0)	;DL+0=loadsync.u
	SW	R0,0004 (V0)	;DL+4=loadsync.l
	ADDIU	V1,V1,0008	;V1+=8: next DL op
//80090754:	loadtile
	SLL	T4,A0,0x1	;T4=x.off*2
	ANDI	T5,T4,0FFF
	SLL	T6,T5,0xC
	LUI	AT,F400
	SLL	T9,A2,0x1	;T9=0xB * 2
	ANDI	T3,T9,0FFF	;T3=T9&0xFFF: uls
	OR	T7,T6,AT	;T7=F4000000 | uls
	ADDIU	A3,A1,000F	;A3=char.u+F
	SLL	T1,A3,0x2	;T1=(char.u+F)*4
	LUI	AT,0700
	SLL	T4,T3,0xC	;T4=T3<<C: lrs
	OR	V0,V1,R0	;V0=V1: p->DL
	SLL	T0,A1,0x2	;T0=char.u*4
	ANDI	T0,T0,0FFF	;T0&=0xFFF: ult
	OR	T5,T4,AT	;T5=tile | lrs
	ANDI	T1,T1,0FFF	;T1&=0xFFF: lrt
	OR	T6,T5,T1	;T6=tile | lrs | lrt
	OR	T8,T7,T0	;T8=F4000000 | uls | ult
	SW	T8,0000 (V0)	;DL+0=loadtile.u: 
	SW	T6,0004 (V0)	;DL+4=loadtile.l: tile 7, lrs, lrt
	ADDIU	V1,V1,0008	;V1+=8: next DL op
//800907A8:	pipesync
	OR	V0,V1,R0	;V0=V1: p->DL
	LUI	T7,E700
	SW	T7,0000 (V0)	;DL+0=pipesync.u
	SW	R0,0004 (V0)	;DL+4=pipesync.l
	ADDIU	V1,V1,0008	;V1+=8: next DL op
//800907BC:	settile
	OR	V0,V1,R0	;V0=V1: p->DL
	LUI	AT,F580
	LUI	T9,000C
	ORI	T9,T9,0300	;T9=000C0300
	OR	T8,T2,AT	;T8=F5800000 | line
	SW	T8,0000 (V0)	;DL+0=settile.u: i, line
	SW	T9,0004 (V0)	;DL+4=settile.l: clamp st mirror st
	ADDIU	V1,V1,0008	;V1+=8: next DL op
//800907DC:	settilesize
	SLL	T3,A0,0x2	;T4=x.off*4
	ANDI	T4,T3,0FFF
	SLL	T8,A2,0x2	;T8=0xB * 4
	ANDI	T9,T8,0FFF
	SLL	T5,T4,0xC	;T5=x.off -> uls
	OR	V0,V1,R0	;V0=V1: p->DL
	LUI	AT,F200
	OR	T6,T5,AT	;T6=F2000000 | uls
	SLL	T3,T9,0xC	;T3=width -> lrs
	OR	T4,T3,T1	;T4=lrs | lrt
	OR	T7,T6,T0	;T7=F2000000 | uls | ult
	SW	T7,0000 (V0)	;DL+0=settilesize.u: uls, ult
	SW	T4,0004 (V0)	;DL+4=settilesize.l: tile 0, lrs, lrt
	ADDIU	V1,V1,0008	;V1+=8: next DL op
//80090814:	return
	LW	T5,0020 (SP)	;T5=SP+20: p->DL pointer
	SW	V1,0000 (T5)	;V1->T5+0: save p->DL to address
	LW	T6,0028 (SP)	;T6=SP+28: @image offset
	SW	A0,0000 (T6)	;A0->T6+0: x offset
	LW	T7,002C (SP)	;T7=SP+2C: @line#
	SW	A1,0000 (T7)	;A1->T7+0: char.upper nibble
	LW	T8,0030 (SP)	;T8=SP+30: @imgoffedge
	SW	A2,0000 (T8)	;A2->T8+0: width
	LW	T9,0034 (SP)	;T9=SP+34: @linebot
	SW	A3,0000 (T9)	;A3->T9+0: height
	LW	RA,0014 (SP)
	JR	RA
	ADDIU	SP,SP,0020

Need to call 80090140 if var.width, A0=char#.  It will fry T6 but return V0=correction.
To get width type, uhm...
	BEQ	V0,R0,+skip	;branch if fixed-width
	OR	A3,R0,A0	;A3=A0, to save x.off
	JAL	80090140	;V0=correction
	LW	A0,0024 (SP)	;A0=char#
	SRL	V0,V0,0x1	;half of that
	ADDU	A3,V0,A3	;A3=offset x.off
	//skip
	LW	T8,0028 (SP)	;T6=SP+28: @image offset
	SW	A3,0000 (T8)
	


Oh, 80091BD8 sets it when building block.  Might be able to set to a static location and simply copy from there.  One way or another, will need a static location for reference, not this crappy "temp only on stack" nonsense.
